1finite(3) Library Functions Manual finite(3)
2
3
4
6 finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl
7 - BSD floating-point classification functions
8
10 Math library (libm, -lm)
11
13 #include <math.h>
14
15 int finite(double x);
16 int finitef(float x);
17 int finitel(long double x);
18
19 int isinf(double x);
20 int isinff(float x);
21 int isinfl(long double x);
22
23 int isnan(double x);
24 int isnanf(float x);
25 int isnanl(long double x);
26
27 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
28
29 finite(), finitef(), finitel():
30 /* glibc >= 2.19: */ _DEFAULT_SOURCE
31 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
32
33 isinf():
34 _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE
35 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
36 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
37
38 isinff(), isinfl():
39 /* glibc >= 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41
42 isnan():
43 _XOPEN_SOURCE || _ISOC99_SOURCE
44 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
45 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
46
47 isnanf(), isnanl():
48 _XOPEN_SOURCE >= 600
49 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
50 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
51
53 The finite(), finitef(), and finitel() functions return a nonzero value
54 if x is neither infinite nor a "not-a-number" (NaN) value, and 0 other‐
55 wise.
56
57 The isnan(), isnanf(), and isnanl() functions return a nonzero value if
58 x is a NaN value, and 0 otherwise.
59
60 The isinf(), isinff(), and isinfl() functions return 1 if x is positive
61 infinity, -1 if x is negative infinity, and 0 otherwise.
62
64 For an explanation of the terms used in this section, see at‐
65 tributes(7).
66
67 ┌────────────────────────────────────────────┬───────────────┬─────────┐
68 │Interface │ Attribute │ Value │
69 ├────────────────────────────────────────────┼───────────────┼─────────┤
70 │finite(), finitef(), finitel(), isinf(), │ Thread safety │ MT-Safe │
71 │isinff(), isinfl(), isnan(), isnanf(), │ │ │
72 │isnanl() │ │ │
73 └────────────────────────────────────────────┴───────────────┴─────────┘
74
76 Note that these functions are obsolete. C99 defines macros isfinite(),
77 isinf(), and isnan() (for all types) replacing them. Further note that
78 the C99 isinf() has weaker guarantees on the return value. See
79 fpclassify(3).
80
82 fpclassify(3)
83
84
85
86Linux man-pages 6.05 2023-07-20 finite(3)