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 2017-09-15 "" "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 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
47 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
49 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
50 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
54 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
55 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
56 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
60 Floating point numbers can have special values, such as
64 you can find out what type
67 The macro takes any floating-point expression as argument.
68 The result is one of the following values:
76 is either positive infinity or negative infinity.
84 is too small to be represented in normalized format.
87 if nothing of the above is correct then it must be a
88 normal floating-point number.
90 The other macros provide a short answer to some standard questions.
93 returns a nonzero value if
95 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
98 returns a nonzero value if
99 (fpclassify(x) == FP_NORMAL)
102 returns a nonzero value if
103 (fpclassify(x) == FP_NAN)
108 is positive infinity, and \-1 if
110 is negative infinity.
112 For an explanation of the terms used in this section, see
119 Interface Attribute Value
126 T} Thread safety MT-Safe
130 POSIX.1-2001, POSIX.1-2008, C99.
134 the standards merely say that the return value is nonzero
135 if and only if the argument has an infinite value.
137 In glibc 2.01 and earlier,
139 returns a nonzero value (actually: 1) if
141 is positive infinity or negative infinity.
142 (This is all that C99 requires.)