]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/nan.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / nan.3
CommitLineData
fea681da 1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2297bf0e 2.\"
38f20bb9 3.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
fea681da 4.\" Distributed under GPL
38f20bb9 5.\" %%%LICENSE_END
51f2944d 6.\"
fea681da
MK
7.\" Based on glibc infopages
8.\"
9.\" Corrections by aeb
51f2944d 10.\"
97986708 11.TH NAN 3 2016-03-15 "GNU" "Linux Programmer's Manual"
fea681da
MK
12.SH NAME
13nan, nanf, nanl \- return 'Not a Number'
14.SH SYNOPSIS
15.B #include <math.h>
68e4db0a 16.PP
fea681da 17.BI "double nan(const char *" tagp );
d39541ec 18.br
fea681da 19.BI "float nanf(const char *" tagp );
d39541ec 20.br
fea681da 21.BI "long double nanl(const char *" tagp );
68e4db0a 22.PP
d39e8d56 23Link with \fI\-lm\fP.
68e4db0a 24.PP
cc4615cc
MK
25.in -4n
26Feature Test Macro Requirements for glibc (see
27.BR feature_test_macros (7)):
28.in
68e4db0a 29.PP
5146e1d4 30.ad l
cc4615cc 31.BR nan (),
e0bf9127 32.BR nanf (),
cc4615cc 33.BR nanl ():
21135fb3 34.RS 4
e464f054 35_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
21135fb3 36.RE
5146e1d4 37.ad
fea681da
MK
38.SH DESCRIPTION
39These functions return a representation (determined by
40.IR tagp )
1c44bd5b
MK
41of a quiet NaN.
42If the implementation does not support
fea681da 43quiet NaNs, these functions return zero.
dd3568a1 44.PP
fea681da
MK
45The call
46.I nan("char-sequence")
5584a528 47is equivalent to:
207050fa 48.PP
408731d4
MK
49.in +4n
50.EX
51strtod("NAN(char-sequence)", NULL);
52.EE
53.in
5584a528
MK
54.PP
55Similarly, calls to
31e9a9ec 56.BR nanf ()
fea681da 57and
31e9a9ec 58.BR nanl ()
fea681da 59are equivalent to analogous calls to
fb186734 60.BR strtof (3)
fea681da 61and
fb186734 62.BR strtold (3).
fea681da
MK
63.PP
64The argument
65.I tagp
c13182ef
MK
66is used in an unspecified manner.
67On IEEE 754 systems, there are many representations of NaN, and
fea681da 68.I tagp
c13182ef
MK
69selects one.
70On other systems it may do nothing.
f0d7ce1d
MK
71.SH VERSIONS
72These functions first appeared in glibc in version 2.1.
09176079
MS
73.SH ATTRIBUTES
74For an explanation of the terms used in this section, see
75.BR attributes (7).
76.TS
77allbox;
081a3b21 78lbw21 lb lb
09176079
MS
79l l l.
80Interface Attribute Value
81T{
82.BR nan (),
83.BR nanf (),
84.BR nanl ()
85T} Thread safety MT-Safe locale
86.TE
47297adb 87.SH CONFORMING TO
9a74e018 88C99, POSIX.1-2001, POSIX.1-2008.
1c44bd5b 89See also IEC 559 and the appendix with
fea681da 90recommended functions in IEEE 754/IEEE 854.
47297adb 91.SH SEE ALSO
fea681da 92.BR isnan (3),
d39e8d56
MK
93.BR strtod (3),
94.BR math_error (7)