> Tags: upstream patch

Looks like this is intended for me?

What man page is this intended for?

> Included is a sample program that demonstrates how to sort IEEE
> floating point values, including NAN and friends, in a useful way;
> please consider including it.
> 
> // make CFLAGS='-W -Wall -O3 -g -std=gnu99' LDFLAGS=-lm fpnansort
> #include <math.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <assert.h>
> 
> int fpcomp(const void *a, const void *b)
> {
>         double x=*(double *)a,
>                y=*(double *)b;
> 
>         if (x<y) return -1;
>         else if (x>y) return 1;
>         // The not-normal values will be grouped together, but
>         // otherwise unordered:
>         else if (!isnormal(x)) return 1;
>         else if (!isnormal(y)) return -1;

Why isnormal()?  

>         assert(x==y);

What is assert doing here?

>         return 0;
> }

Cheers,

Michael

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7 

Want to help with man page maintenance?  
Grab the latest tarball at
ftp://ftp.win.tue.nl/pub/linux-local/manpages/, 
read the HOWTOHELP file and grep the source 
files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to