summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fpclassify.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/fpclassify.3')
-rw-r--r--lib/libc/gen/fpclassify.364
1 files changed, 56 insertions, 8 deletions
diff --git a/lib/libc/gen/fpclassify.3 b/lib/libc/gen/fpclassify.3
index 3ed831fb08e40..795887da2a60e 100644
--- a/lib/libc/gen/fpclassify.3
+++ b/lib/libc/gen/fpclassify.3
@@ -24,11 +24,11 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 8, 2003
+.Dd February 12, 2003
.Dt FPCLASSIFY 3
.Os
.Sh NAME
-.Nm fpclassify
+.Nm fpclassify , isfinite , isinf , isnan , isnormal
.Nd "classify a floating-point number"
.Sh LIBRARY
.Lb libc
@@ -36,6 +36,14 @@
.In math.h
.Ft int
.Fn fpclassify "real-floating x"
+.Ft int
+.Fn isfinite "real-floating x"
+.Ft int
+.Fn isinf "real-floating x"
+.Ft int
+.Fn isnan "real-floating x"
+.Ft int
+.Fn isnormal "real-floating x"
.Sh DESCRIPTION
The
.Fn fpclassify
@@ -64,18 +72,58 @@ Indicates that
.Va x
is zero (0 or -0).
.El
+.Pp
+The
+.Fn isfinite
+macro returns a non-zero value if and only if its argument has
+a finite (zero, subnormal, or normal) value. The
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros return non-zero if and only if
+.Va x
+is an infinity, NaN,
+or a non-zero normalized number, respectively.
+.Pp
+The symbol
+.Fn isnanf
+is provided as an alias to
+.Fn isnan
+for compatibility, and its use is deprecated.
.Sh SEE ALSO
-.Xr math 3
+.Xr isgreater 3 ,
+.Xr math 3 ,
+.Xr signbit 3
.Sh STANDARDS
The
-.Fn fpclassify
-macro conforms to
+.Fn fpclassify ,
+.Fn isfinite ,
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros conform to
.St -isoC-99 .
.Sh HISTORY
The
-.Fn fpclassify
-macro was added in
+.Fn fpclassify ,
+.Fn isfinite ,
+.Fn isinf ,
+.Fn isnan ,
+and
+.Fn isnormal
+macros were added in
.Fx 5.1 .
+.Bx 3
+introduced
+.Fn isinf
+and
+.Fn isnan
+functions, which accepted
+.Ft double
+arguments; these have been superseded by the macros
+described above.
.Sh BUGS
By default, the DEC Alpha architecture does not support IEEE rounding.
-See compiler documentation for additional details.
+See the compiler documentation for additional details.