1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL, 2002-07-27 Walter Harms
3 .\" This was done with the help of the glibc manual.
5 .\" 2004-10-31, aeb, corrected
6 .TH FPCLASSIFY 3 2010-09-20 "" "Linux Programmer's Manual"
8 fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
14 .BI "int fpclassify(" x );
16 .BI "int isfinite(" x );
18 .BI "int isnormal(" x );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
32 .\" I haven't fully grokked the source to determine the FTM requirements;
33 .\" in part, the following has been tested by experiment.
39 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
40 _POSIX_C_SOURCE\ >=\ 200112L;
47 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
48 _POSIX_C_SOURCE\ >=\ 200112L;
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
56 _POSIX_C_SOURCE\ >=\ 200112L;
63 Floating point numbers can have special values, such as
67 you can find out what type
70 The macro takes any floating-point expression as argument.
71 The result is one of the following values:
79 is either positive infinity or negative infinity.
87 is too small to be represented in normalized format.
90 if nothing of the above is correct then it must be a
91 normal floating-point number.
93 The other macros provide a short answer to some standard questions.
96 returns a nonzero value if
98 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
101 returns a nonzero value if
102 (fpclassify(x) == FP_NORMAL)
105 returns a nonzero value if
106 (fpclassify(x) == FP_NAN)
111 is positive infinity, and \-1 if
113 is negative infinity.
119 the standards merely say that the return value is nonzero
120 if and only if the argument has an infinite value.
122 In glibc 2.01 and earlier,
124 returns a nonzero value (actually: 1) if
126 is positive infinity or negative infinity.
127 (This is all that C99 requires.)