]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/nan.3
getent.1, intro.1, time.1, _exit.2, _syscall.2, accept.2, access.2, acct.2, adjtimex...
[thirdparty/man-pages.git] / man3 / nan.3
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
6 .TH NAN 3 2010-09-20 "GNU" "Linux Programmer's Manual"
7 .SH NAME
8 nan, nanf, nanl \- return 'Not a Number'
9 .SH SYNOPSIS
10 .B #include <math.h>
11 .sp
12 .BI "double nan(const char *" tagp );
13 .br
14 .BI "float nanf(const char *" tagp );
15 .br
16 .BI "long double nanl(const char *" tagp );
17 .sp
18 Link with \fI\-lm\fP.
19 .sp
20 .in -4n
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .in
24 .sp
25 .ad l
26 .BR nan (),
27 .BR nanf (),
28 .BR nanl ():
29 .RS 4
30 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
31 _POSIX_C_SOURCE\ >=\ 200112L;
32 .br
33 or
34 .I cc\ -std=c99
35 .RE
36 .ad
37 .SH DESCRIPTION
38 These functions return a representation (determined by
39 .IR tagp )
40 of a quiet NaN.
41 If the implementation does not support
42 quiet NaNs, these functions return zero.
43 .LP
44 The call
45 .I nan("char-sequence")
46 is equivalent to:
47 .nf
48
49 strtod("NAN(char-sequence)", NULL);
50 .fi
51 .PP
52 Similarly, calls to
53 .BR nanf ()
54 and
55 .BR nanl ()
56 are equivalent to analogous calls to
57 .BR strtof (3)
58 and
59 .BR strtold (3).
60 .PP
61 The argument
62 .I tagp
63 is used in an unspecified manner.
64 On IEEE 754 systems, there are many representations of NaN, and
65 .I tagp
66 selects one.
67 On other systems it may do nothing.
68 .SH VERSIONS
69 These functions first appeared in glibc in version 2.1.
70 .SH CONFORMING TO
71 C99, POSIX.1-2001.
72 See also IEC 559 and the appendix with
73 recommended functions in IEEE 754/IEEE 854.
74 .SH SEE ALSO
75 .BR isnan (3),
76 .BR strtod (3),
77 .BR math_error (7)