On 5/2/22 06:31, Pádraig Brady wrote:
This is a bit slower of course, but since an edge case not a big concern:
Yes, my thoughts too. There are ways to speed up common lots-o-NaN cases portably (I toyed with the idea of using ieee754.h), but I went with the simple approach for now.
A nit: 'time' needs to be at the end of the pipeline: $ yes nan | head -n128095 | bash -c 'time src/sort -g' >/dev/null real 0m0.552s user 0m0.551s sys 0m0.001s $ yes nan | head -n128095 | bash -c 'time sort -g' >/dev/null real 0m0.392s user 0m0.382s sys 0m0.009s 512-day $ yes nan | head -n128095 | bash -c 'time sort -g' >/dev/null [Here I had to control-C since 'sort' inflooped.]