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 2021-03-22 "" "Linux Programmer's Manual"
12 fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
18 .BI "int fpclassify(" x );
19 .BI "int isfinite(" x );
20 .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
129 POSIX.1-2001, POSIX.1-2008, C99.
133 the standards merely say that the return value is nonzero
134 if and only if the argument has an infinite value.
136 In glibc 2.01 and earlier,
138 returns a nonzero value (actually: 1) if
140 is positive infinity or negative infinity.
141 (This is all that C99 requires.)