blob: 9590579f7410354e812949171e12dfeb582c5746 [file] [log] [blame]
rsccfa37a72004-04-10 18:53:55 +00001.TH NAN 3
2.SH NAME
3NaN, Inf, isNaN, isInf \- not-a-number and infinity functions
4.SH SYNOPSIS
5.B #include <u.h>
6.br
7.B #include <libc.h>
8.PP
9.ta \w'\fLdouble 'u
10.B
11double NaN(void)
12.PP
13.B
14double Inf(int)
15.PP
16.B
17int isNaN(double)
18.PP
19.B
20int isInf(double, int)
21.SH DESCRIPTION
22The IEEE floating point standard defines values called
23`not-a-number' and positive and negative `infinity'.
24These values can be produced by such things as overflow
25and division by zero.
26Also, the library functions sometimes return them when
27the arguments are not in the domain, or the result is
28out of range.
29.PP
30.I NaN
31returns a double that is not-a-number.
32.I IsNaN
33returns true if its argument is not-a-number.
34.PP
35.IR Inf ( i )
36returns positive infinity if
37.I i
38is greater than or equal to zero,
39else negative infinity.
40.I IsInf
41returns true if its first argument is infinity
42with the same sign as the second argument.
43.SH SOURCE
rscc3674de2005-01-11 17:37:33 +000044.B \*9/src/lib9/nan.c