#include <stdio.h>
#include <math.h>
int main()
{
long double x = NAN;
printf("x = %Lg\nisnan(x) = %d\n", x, isnan(x));
return 0;
}
When I run the above program, I get the output:
x = nan
isnan(x) = 0
According to the manpage, isnan
is supposed to return a nonzero value when the argument is NaN. So why is it returning zero?
Not sure this is relevant, but...