rtld - Support static TLS bindings for late-loaded shared libraries
[dragonfly.git] / contrib / openbsd_libm / man / nan.3
1 .\"     $OpenBSD: nan.3,v 1.5 2011/07/07 01:34:52 martynas Exp $
2 .\"
3 .\" Copyright (c) 2007 David Schultz <das@FreeBSD.org>
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD: src/lib/msun/man/nan.3,v 1.1 2007/12/16 21:19:28 das Exp $
28 .\"
29 .Dd $Mdocdate: July 7 2011 $
30 .Dt NAN 3
31 .Os
32 .Sh NAME
33 .Nm nan ,
34 .Nm nanf ,
35 .Nm nanl
36 .Nd quiet \*(Nas
37 .Sh SYNOPSIS
38 .In math.h
39 .Ft double
40 .Fn nan "const char *s"
41 .Ft float
42 .Fn nanf "const char *s"
43 .Ft long double
44 .Fn nanl "const char *s"
45 .Sh DESCRIPTION
46 The
47 .Dv NAN
48 macro expands to a quiet \*(Na (Not A Number).
49 Similarly both the
50 .Fn nan ,
51 .Fn nanf
52 and
53 .Fn nanl
54 functions generate a quiet \*(Na value without raising an invalid exception.
55 The argument
56 .Fa s
57 should point to either an empty string or a hexadecimal representation
58 of a non-negative integer (e.g. 0x1234).
59 In the latter case, the integer is encoded in some free bits in the
60 representation of the \*(Na, which sometimes stores
61 machine-specific information about why a particular \*(Na was generated.
62 There are 22 such bits available for
63 .Vt float
64 variables, 51 bits for
65 .Vt double
66 variables, and at least 51 bits for a
67 .Vt long double .
68 If
69 .Fa s
70 is improperly formatted or represents an integer that is too large,
71 then the particular encoding of the quiet \*(Na that is returned
72 is indeterminate.
73 .Sh COMPATIBILITY
74 Calling these functions with a non-empty string isn't portable.
75 Another operating system may translate the string into a different
76 \*(Na encoding, and furthermore, the meaning of a given \*(Na encoding
77 varies across machine architectures.
78 If you understood the innards of a particular platform well enough to
79 know what string to use, then you would have no need for these functions
80 anyway, so don't use them.
81 Use the
82 .Dv NAN
83 macro instead.
84 .Sh SEE ALSO
85 .Xr isnan 3 ,
86 .Xr strtod 3
87 .Sh STANDARDS
88 The
89 .Fn nan ,
90 .Fn nanf
91 and
92 .Fn nanl
93 functions and the
94 .Dv NAN
95 macro conform to
96 .St -isoC-99 .