Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/man/2/nan

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TH NAN 2
.SH NAME
NaN, Inf, isNaN, isInf \- not-a-number and infinity functions
.SH SYNOPSIS
.B #include <u.h>
.br
.B #include <libc.h>
.PP
.ta \w'\fLdouble 'u
.B
double	NaN(void)
.PP
.B
double	Inf(int)
.PP
.B
int	isNaN(double)
.PP
.B
int	isInf(double, int)
.SH DESCRIPTION
The IEEE floating point standard defines values called
`not-a-number' and positive and negative `infinity'.
These values can be produced by such things as overflow
and division by zero.
Also, the library functions sometimes return them when
the arguments are not in the domain, or the result is
out of range.
By default, manipulating these values may cause a floating point exception
on some processors but
.I setfcr
(see
.IR getfcr (2))
can change that behavior.
.PP
.I NaN
returns a double that is not-a-number.
.I IsNaN
returns true if its argument is not-a-number.
.PP
.IR Inf ( i )
returns positive infinity if
.I i
is greater than or equal to zero,
else negative infinity.
.I IsInf
returns true if its first argument is infinity
with the same sign as the second argument.
.SH SOURCE
.B /sys/src/libc/port/nan.c
.SH "SEE ALSO"
.IR getfcr (2)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].