2 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
6 .\" This was done with the help of the glibc manual.
8 .\" 2004-10-31, aeb, corrected
9 .TH fpclassify 3 (date) "Linux man-pages (unreleased)"
11 fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
15 .RI ( libm ", " \-lm )
20 .BI "int fpclassify(" x );
21 .BI "int isfinite(" x );
22 .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.
38 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
43 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
45 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
46 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
51 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
52 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
53 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
56 Floating point numbers can have special values, such as
60 you can find out what type
63 The macro takes any floating-point expression as argument.
64 The result is one of the following values:
72 is either positive infinity or negative infinity.
80 is too small to be represented in normalized format.
83 if nothing of the above is correct then it must be a
84 normal floating-point number.
86 The other macros provide a short answer to some standard questions.
89 returns a nonzero value if
91 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
94 returns a nonzero value if
95 (fpclassify(x) == FP_NORMAL)
98 returns a nonzero value if
99 (fpclassify(x) == FP_NAN)
104 is positive infinity, and \-1 if
106 is negative infinity.
108 For an explanation of the terms used in this section, see
116 Interface Attribute Value
123 T} Thread safety MT-Safe
133 In glibc 2.01 and earlier,
135 returns a nonzero value (actually: 1) if
137 is positive infinity or negative infinity.
138 (This is all that C99 requires.)
142 the standards merely say that the return value is nonzero
143 if and only if the argument has an infinite value.