1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\" This was done with the help of the glibc manual.
7 .\" 2004-10-31, aeb, corrected
8 .TH FPCLASSIFY 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
10 fpclassify, isfinite, isnormal, isnan, isinf \- floating-point
14 .RI ( libm ", " \-lm )
19 .BI "int fpclassify(" x );
20 .BI "int isfinite(" x );
21 .BI "int isnormal(" x );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
31 .\" I haven't fully grokked the source to determine the FTM requirements;
32 .\" in part, the following has been tested by experiment.
37 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
42 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
44 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
45 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
50 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
51 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
52 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
55 Floating point numbers can have special values, such as
59 you can find out what type
62 The macro takes any floating-point expression as argument.
63 The result is one of the following values:
71 is either positive infinity or negative infinity.
79 is too small to be represented in normalized format.
82 if nothing of the above is correct then it must be a
83 normal floating-point number.
85 The other macros provide a short answer to some standard questions.
88 returns a nonzero value if
90 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
93 returns a nonzero value if
94 (fpclassify(x) == FP_NORMAL)
97 returns a nonzero value if
98 (fpclassify(x) == FP_NAN)
103 is positive infinity, and \-1 if
105 is negative infinity.
107 For an explanation of the terms used in this section, see
115 Interface Attribute Value
122 T} Thread safety MT-Safe
128 POSIX.1-2001, POSIX.1-2008, C99.
132 the standards merely say that the return value is nonzero
133 if and only if the argument has an infinite value.
135 In glibc 2.01 and earlier,
137 returns a nonzero value (actually: 1) if
139 is positive infinity or negative infinity.
140 (This is all that C99 requires.)