Debian Codegraph @

upstream/debian-unstable/man3/finite.3

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