41 |
inline |
inline |
42 |
bool nancheck(double d) |
bool nancheck(double d) |
43 |
{ |
{ |
44 |
#ifndef FP_NAN // Q: so why not just test d!=d? |
#ifndef isnan // Q: so why not just test d!=d? |
45 |
return false; // A: Coz it doesn't always work [I've checked]. |
return false; // A: Coz it doesn't always work [I've checked]. |
46 |
#else // One theory is that the optimizer skips the test. |
#else // One theory is that the optimizer skips the test. |
47 |
return isnan(d); |
return isnan(d); |
55 |
inline |
inline |
56 |
double makeNaN() |
double makeNaN() |
57 |
{ |
{ |
58 |
#ifndef FP_NAN |
#ifndef isnan |
59 |
return nan(); |
return nan(); |
60 |
#else |
#else |
61 |
return sqrt(-1); |
return sqrt(-1); |