]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/gen/fpclassify.3
sqlite3: Vendor import of sqlite3 3.45.0
[FreeBSD/FreeBSD.git] / lib / libc / gen / fpclassify.3
1 .\" Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .Dd January 26, 2005
26 .Dt FPCLASSIFY 3
27 .Os
28 .Sh NAME
29 .Nm fpclassify , isfinite , isinf , isnan , isnormal
30 .Nd "classify a floating-point number"
31 .Sh LIBRARY
32 .Lb libm
33 .Sh SYNOPSIS
34 .In math.h
35 .Ft int
36 .Fn fpclassify "real-floating x"
37 .Ft int
38 .Fn isfinite "real-floating x"
39 .Ft int
40 .Fn isinf "real-floating x"
41 .Ft int
42 .Fn isnan "real-floating x"
43 .Ft int
44 .Fn isnormal "real-floating x"
45 .Sh DESCRIPTION
46 The
47 .Fn fpclassify
48 macro takes an argument of
49 .Fa x
50 and returns one of the following manifest constants.
51 .Bl -tag -width ".Dv FP_SUBNORMAL"
52 .It Dv FP_INFINITE
53 Indicates that
54 .Fa x
55 is an infinite number.
56 .It Dv FP_NAN
57 Indicates that
58 .Fa x
59 is not a number (NaN).
60 .It Dv FP_NORMAL
61 Indicates that
62 .Fa x
63 is a normalized number.
64 .It Dv FP_SUBNORMAL
65 Indicates that
66 .Fa x
67 is a denormalized number.
68 .It Dv FP_ZERO
69 Indicates that
70 .Fa x
71 is zero (0 or \-0).
72 .El
73 .Pp
74 The
75 .Fn isfinite
76 macro returns a non-zero value if and only if its argument has
77 a finite (zero, subnormal, or normal) value.
78 The
79 .Fn isinf ,
80 .Fn isnan ,
81 and
82 .Fn isnormal
83 macros return non-zero if and only if
84 .Fa x
85 is an infinity, NaN,
86 or a non-zero normalized number, respectively.
87 .Pp
88 The symbol
89 .Fn isnanf
90 is provided as an alias to
91 .Fn isnan
92 for compatibility, and its use is deprecated.
93 Similarly,
94 .Fn finite
95 and
96 .Fn finitef
97 are deprecated versions of
98 .Fn isfinite .
99 .Sh SEE ALSO
100 .Xr isgreater 3 ,
101 .Xr math 3 ,
102 .Xr signbit 3
103 .Sh STANDARDS
104 The
105 .Fn fpclassify ,
106 .Fn isfinite ,
107 .Fn isinf ,
108 .Fn isnan ,
109 and
110 .Fn isnormal
111 macros conform to
112 .St -isoC-99 .
113 .Sh HISTORY
114 The
115 .Fn fpclassify ,
116 .Fn isfinite ,
117 .Fn isinf ,
118 .Fn isnan ,
119 and
120 .Fn isnormal
121 macros were added in
122 .Fx 5.1 .
123 .Bx 3
124 introduced
125 .Fn isinf
126 and
127 .Fn isnan
128 functions, which accepted
129 .Vt double
130 arguments; these have been superseded by the macros
131 described above.