Debian Codegraph @

upstream/debian-trixie/man3/finite.3

raw
1 '\" t
2 .\" Copyright 2004 Andries Brouwer <[email protected]>.
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH finite 3 2024-05-02 "Linux man-pages 6.9.1"
7 .SH NAME
8 finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl \-
9 BSD floating-point classification functions
10 .SH LIBRARY
11 Math library
12 .RI ( libm ", " \-lm )
13 .SH SYNOPSIS
14 .nf
15 .B #include <math.h>
16 .P
17 .BI "int finite(double " x );
18 .BI "int finitef(float " x );
19 .BI "int finitel(long double " x );
20 .P
21 .BI "int isinf(double " x );
22 .BI "int isinff(float " x );
23 .BI "int isinfl(long double " x );
24 .P
25 .BI "int isnan(double " x );
26 .BI "int isnanf(float " x );
27 .BI "int isnanl(long double " x );
28 .fi
29 .P
30 .RS -4
31 Feature Test Macro Requirements for glibc (see
32 .BR feature_test_macros (7)):
33 .RE
34 .P
35 .BR finite (),
36 .BR finitef (),
37 .BR finitel ():
38 .nf
39 /* glibc >= 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 .P
42 .BR isinf ():
43 _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE
44 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
45 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
46 .fi
47 .P
48 .BR isinff (),
49 .BR isinfl ():
50 .nf
51 /* glibc >= 2.19: */ _DEFAULT_SOURCE
52 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
53 .fi
54 .P
55 .BR isnan ():
56 .nf
57 _XOPEN_SOURCE || _ISOC99_SOURCE
58 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
59 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
60 .fi
61 .P
62 .BR isnanf (),
63 .BR isnanl ():
64 .nf
65 _XOPEN_SOURCE >= 600
66 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
67 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
68 .fi
69 .SH DESCRIPTION
70 The
71 .BR finite (),
72 .BR finitef (),
73 and
74 .BR finitel ()
75 functions return a nonzero value if
76 .I x
77 is neither infinite
78 nor a "not-a-number" (NaN) value, and 0 otherwise.
79 .P
80 The
81 .BR isnan (),
82 .BR isnanf (),
83 and
84 .BR isnanl ()
85 functions return a nonzero value if
86 .I x
87 is a NaN value,
88 and 0 otherwise.
89 .P
90 The
91 .BR isinf (),
92 .BR isinff (),
93 and
94 .BR isinfl ()
95 functions return 1 if
96 .I x
97 is positive infinity, \-1 if
98 .I x
99 is negative infinity, and 0 otherwise.
100 .SH ATTRIBUTES
101 For an explanation of the terms used in this section, see
102 .BR attributes (7).
103 .TS
104 allbox;
105 lbx lb lb
106 l l l.
107 Interface Attribute Value
108 T{
109 .na
110 .nh
111 .BR finite (),
112 .BR finitef (),
113 .BR finitel (),
114 .BR isinf (),
115 .BR isinff (),
116 .BR isinfl (),
117 .BR isnan (),
118 .BR isnanf (),
119 .BR isnanl ()
120 T} Thread safety MT-Safe
121 .TE
122 .SH NOTES
123 Note that these functions are obsolete.
124 C99 defines macros
125 .BR isfinite (),
126 .BR isinf (),
127 and
128 .BR isnan ()
129 (for all types) replacing them.
130 Further note that the C99
131 .BR isinf ()
132 has weaker guarantees on the return value.
133 See
134 .BR fpclassify (3).
135 .\"
136 .\" finite* not on HP-UX; they exist on Tru64.
137 .\" .SH HISTORY
138 .\" The
139 .\" .BR finite ()
140 .\" function occurs in 4.3BSD.
141 .\" see IEEE.3 in the 4.3BSD manual
142 .SH SEE ALSO
143 .BR fpclassify (3)