[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <math.h> |
The macro fpclassify
returns the kind of the floating point
value supplied.
FP_INFINITE
, FP_NAN
, FP_NORMAL
,
FP_SUBNORMAL
, FP_ZERO
or FP_UNNORMAL
.
ANSI/ISO C | C99; not C89 |
float f = 1; double d = INFINITY; long double ld = NAN; if( fpclassify(f) != FP_NORMAL ) { printf("Something is wrong with the implementation!\n"); } if( fpclassify(d) != FP_INFINITE ) { printf("Something is wrong with the implementation!\n"); } if( fpclassify(ld) != FP_NAN ) { printf("Something is wrong with the implementation!\n"); } |