]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/nan.3
nan.3: ffix
[thirdparty/man-pages.git] / man3 / nan.3
CommitLineData
fea681da
MK
1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2.\" Distributed under GPL
3.\" Based on glibc infopages
4.\"
5.\" Corrections by aeb
f0d7ce1d 6.TH NAN 3 2008-08-11 "GNU" "Linux Programmer's Manual"
fea681da
MK
7.SH NAME
8nan, nanf, nanl \- return 'Not a Number'
9.SH SYNOPSIS
10.B #include <math.h>
11.sp
12.BI "double nan(const char *" tagp );
d39541ec 13.br
fea681da 14.BI "float nanf(const char *" tagp );
d39541ec 15.br
fea681da
MK
16.BI "long double nanl(const char *" tagp );
17.sp
d39e8d56 18Link with \fI\-lm\fP.
cc4615cc
MK
19.sp
20.in -4n
21Feature Test Macro Requirements for glibc (see
22.BR feature_test_macros (7)):
23.in
24.sp
25.BR nan (),
e0bf9127 26.BR nanf (),
cc4615cc 27.BR nanl ():
21135fb3
MK
28.RS 4
29_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE;
30.br
31or
cc4615cc 32.I cc\ -std=c99
21135fb3 33.RE
fea681da
MK
34.SH DESCRIPTION
35These functions return a representation (determined by
36.IR tagp )
1c44bd5b
MK
37of a quiet NaN.
38If the implementation does not support
fea681da
MK
39quiet NaNs, these functions return zero.
40.LP
41The call
42.I nan("char-sequence")
5584a528
MK
43is equivalent to:
44.nf
45
46 strtod("NAN(char-sequence)", NULL);
47.fi
48.PP
49Similarly, calls to
31e9a9ec 50.BR nanf ()
fea681da 51and
31e9a9ec 52.BR nanl ()
fea681da 53are equivalent to analogous calls to
fb186734 54.BR strtof (3)
fea681da 55and
fb186734 56.BR strtold (3).
fea681da
MK
57.PP
58The argument
59.I tagp
c13182ef
MK
60is used in an unspecified manner.
61On IEEE 754 systems, there are many representations of NaN, and
fea681da 62.I tagp
c13182ef
MK
63selects one.
64On other systems it may do nothing.
f0d7ce1d
MK
65.SH VERSIONS
66These functions first appeared in glibc in version 2.1.
fea681da 67.SH "CONFORMING TO"
cfe08d1e 68C99, POSIX.1-2001.
1c44bd5b 69See also IEC 559 and the appendix with
fea681da
MK
70recommended functions in IEEE 754/IEEE 854.
71.SH "SEE ALSO"
72.BR isnan (3),
d39e8d56
MK
73.BR strtod (3),
74.BR math_error (7)