_isnan, _isnanl
Remonter à float.h - Index
Header File
float.h
Category
Classification Routines, Math Routines
Prototype
int _isnan(double d);
int _isnanl(long double ld);
Description
Tests whether a given double-precision floating-point value d is a NaN.
_isnanl is the long double version; it takes a long double argument.
Return Value
Returns a nonzero value (TRUE) if the value passed in is a NaN; otherwise it returns 0 (FALSE). The non-zero return value corresponds to either _FPCLASS_SNAN, if the NaN is of the signaling type, or _FPCLASS_QNAN, if the NaN is of the quiet type. The values for _FPCLASS_SNAN and _FPCLASS_QNAN are in float.h.
Example
#include <math.h> int print_double(double value) { /* print "Infinite" if value is NaN */ if (_isnan(value)) printf("Infinite"); else printf("%f", value); }
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
_isnan |
+ |
|||
_isnanl |
+ |