1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
7 .\" This was done with the help of the glibc manual.
9 .\" 2004-10-31, aeb, corrected
10 .TH FPCLASSIFY 3 2010-09-20 "" "Linux Programmer's Manual"
12 fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
18 .BI "int fpclassify(" x );
20 .BI "int isfinite(" x );
22 .BI "int isnormal(" x );
32 Feature Test Macro Requirements for glibc (see
33 .BR feature_test_macros (7)):
36 .\" I haven't fully grokked the source to determine the FTM requirements;
37 .\" in part, the following has been tested by experiment.
43 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
44 _POSIX_C_SOURCE\ >=\ 200112L;
51 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
52 _POSIX_C_SOURCE\ >=\ 200112L;
59 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
60 _POSIX_C_SOURCE\ >=\ 200112L;
67 Floating point numbers can have special values, such as
71 you can find out what type
74 The macro takes any floating-point expression as argument.
75 The result is one of the following values:
83 is either positive infinity or negative infinity.
91 is too small to be represented in normalized format.
94 if nothing of the above is correct then it must be a
95 normal floating-point number.
97 The other macros provide a short answer to some standard questions.
100 returns a nonzero value if
102 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
105 returns a nonzero value if
106 (fpclassify(x) == FP_NORMAL)
109 returns a nonzero value if
110 (fpclassify(x) == FP_NAN)
115 is positive infinity, and \-1 if
117 is negative infinity.
123 the standards merely say that the return value is nonzero
124 if and only if the argument has an infinite value.
126 In glibc 2.01 and earlier,
128 returns a nonzero value (actually: 1) if
130 is positive infinity or negative infinity.
131 (This is all that C99 requires.)