How to use nan and inf in C?
You can test if your implementation has it: #include <math.h> #ifdef NAN /* NAN is supported */ #endif #ifdef INFINITY /* INFINITY is supported */ #endif The existence of INFINITY is guaranteed by C99 (or the latest draft at least), and “expands to a constant expression of type float representing positive or unsigned infinity, if … Read more