blob: 9590579f7410354e812949171e12dfeb582c5746 [file] [log] [blame]
NaN, Inf, isNaN, isInf \- not-a-number and infinity functions
.B #include <u.h>
.B #include <libc.h>
.ta \w'\fLdouble 'u
double NaN(void)
double Inf(int)
int isNaN(double)
int isInf(double, int)
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.
.I NaN
returns a double that is not-a-number.
.I IsNaN
returns true if its argument is not-a-number.
.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.
.B \*9/src/lib9/nan.c