]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
95fb8859 | 3 | .\" SPDX-License-Identifier: GPL-1.0-or-later |
51f2944d | 4 | .\" |
fea681da MK |
5 | .\" Based on glibc infopages |
6 | .\" | |
7 | .\" Corrections by aeb | |
51f2944d | 8 | .\" |
45186a5d | 9 | .TH NAN 3 2021-03-22 "Linux man-pages (unreleased)" |
fea681da MK |
10 | .SH NAME |
11 | nan, nanf, nanl \- return 'Not a Number' | |
0e368282 AC |
12 | .SH LIBRARY |
13 | Math library | |
8fc3b2cf | 14 | .RI ( libm ", " \-lm ) |
fea681da | 15 | .SH SYNOPSIS |
c7db92b9 | 16 | .nf |
fea681da | 17 | .B #include <math.h> |
68e4db0a | 18 | .PP |
fea681da | 19 | .BI "double nan(const char *" tagp ); |
fea681da | 20 | .BI "float nanf(const char *" tagp ); |
fea681da | 21 | .BI "long double nanl(const char *" tagp ); |
c7db92b9 | 22 | .fi |
68e4db0a | 23 | .PP |
d39ad78f | 24 | .RS -4 |
cc4615cc MK |
25 | Feature Test Macro Requirements for glibc (see |
26 | .BR feature_test_macros (7)): | |
d39ad78f | 27 | .RE |
68e4db0a | 28 | .PP |
cc4615cc | 29 | .BR nan (), |
e0bf9127 | 30 | .BR nanf (), |
cc4615cc | 31 | .BR nanl (): |
9d2adbae | 32 | .nf |
5c10d2c5 | 33 | _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
9d2adbae | 34 | .fi |
fea681da MK |
35 | .SH DESCRIPTION |
36 | These functions return a representation (determined by | |
37 | .IR tagp ) | |
1c44bd5b MK |
38 | of a quiet NaN. |
39 | If the implementation does not support | |
fea681da | 40 | quiet NaNs, these functions return zero. |
dd3568a1 | 41 | .PP |
fea681da | 42 | The call |
cd415e73 | 43 | .I nan("char\-sequence") |
5584a528 | 44 | is equivalent to: |
207050fa | 45 | .PP |
408731d4 MK |
46 | .in +4n |
47 | .EX | |
d064d41a | 48 | strtod("NAN(char\-sequence)", NULL); |
408731d4 MK |
49 | .EE |
50 | .in | |
5584a528 MK |
51 | .PP |
52 | Similarly, calls to | |
31e9a9ec | 53 | .BR nanf () |
fea681da | 54 | and |
31e9a9ec | 55 | .BR nanl () |
fea681da | 56 | are equivalent to analogous calls to |
fb186734 | 57 | .BR strtof (3) |
fea681da | 58 | and |
fb186734 | 59 | .BR strtold (3). |
fea681da MK |
60 | .PP |
61 | The argument | |
62 | .I tagp | |
c13182ef MK |
63 | is used in an unspecified manner. |
64 | On IEEE 754 systems, there are many representations of NaN, and | |
fea681da | 65 | .I tagp |
c13182ef MK |
66 | selects one. |
67 | On other systems it may do nothing. | |
f0d7ce1d MK |
68 | .SH VERSIONS |
69 | These functions first appeared in glibc in version 2.1. | |
09176079 MS |
70 | .SH ATTRIBUTES |
71 | For an explanation of the terms used in this section, see | |
72 | .BR attributes (7). | |
c466875e MK |
73 | .ad l |
74 | .nh | |
09176079 MS |
75 | .TS |
76 | allbox; | |
c466875e | 77 | lbx lb lb |
09176079 MS |
78 | l l l. |
79 | Interface Attribute Value | |
80 | T{ | |
81 | .BR nan (), | |
82 | .BR nanf (), | |
83 | .BR nanl () | |
84 | T} Thread safety MT-Safe locale | |
85 | .TE | |
c466875e MK |
86 | .hy |
87 | .ad | |
88 | .sp 1 | |
3113c7f3 | 89 | .SH STANDARDS |
9a74e018 | 90 | C99, POSIX.1-2001, POSIX.1-2008. |
1c44bd5b | 91 | See also IEC 559 and the appendix with |
fea681da | 92 | recommended functions in IEEE 754/IEEE 854. |
47297adb | 93 | .SH SEE ALSO |
fea681da | 94 | .BR isnan (3), |
d39e8d56 MK |
95 | .BR strtod (3), |
96 | .BR math_error (7) |