OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / nan.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\" Based on glibc infopages
8 .\"
9 .\" Corrections by aeb
10 .\"
11 .TH NAN 3 2010-09-20 "GNU" "Linux Programmer's Manual"
12 .SH NAME
13 nan, nanf, nanl \- return 'Not a Number'
14 .SH SYNOPSIS
15 .B #include <math.h>
16 .sp
17 .BI "double nan(const char *" tagp );
18 .br
19 .BI "float nanf(const char *" tagp );
20 .br
21 .BI "long double nanl(const char *" tagp );
22 .sp
23 Link with \fI\-lm\fP.
24 .sp
25 .in -4n
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .in
29 .sp
30 .ad l
31 .BR nan (),
32 .BR nanf (),
33 .BR nanl ():
34 .RS 4
35 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
36 _POSIX_C_SOURCE\ >=\ 200112L;
37 .br
38 or
39 .I cc\ -std=c99
40 .RE
41 .ad
42 .SH DESCRIPTION
43 These functions return a representation (determined by
44 .IR tagp )
45 of a quiet NaN.
46 If the implementation does not support
47 quiet NaNs, these functions return zero.
48 .LP
49 The call
50 .I nan("char-sequence")
51 is equivalent to:
52 .nf
53
54     strtod("NAN(char-sequence)", NULL);
55 .fi
56 .PP
57 Similarly, calls to
58 .BR nanf ()
59 and
60 .BR nanl ()
61 are equivalent to analogous calls to
62 .BR strtof (3)
63 and
64 .BR strtold (3).
65 .PP
66 The argument
67 .I tagp
68 is used in an unspecified manner.
69 On IEEE 754 systems, there are many representations of NaN, and
70 .I tagp
71 selects one.
72 On other systems it may do nothing.
73 .SH VERSIONS
74 These functions first appeared in glibc in version 2.1.
75 .SH CONFORMING TO
76 C99, POSIX.1-2001.
77 See also IEC 559 and the appendix with
78 recommended functions in IEEE 754/IEEE 854.
79 .SH SEE ALSO
80 .BR isnan (3),
81 .BR strtod (3),
82 .BR math_error (7)
83 .SH COLOPHON
84 This page is part of release 3.79 of the Linux
85 .I man-pages
86 project.
87 A description of the project,
88 information about reporting bugs,
89 and the latest version of this page,
90 can be found at
91 \%http://www.kernel.org/doc/man\-pages/.