]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/msun/man/ieee.3
This commit was generated by cvs2svn to compensate for changes in r56067,
[FreeBSD/FreeBSD.git] / lib / msun / man / ieee.3
1 .\" Copyright (c) 1985, 1991 Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     from: @(#)ieee.3        6.4 (Berkeley) 5/6/91
33 .\" $FreeBSD$
34 .\"
35 .Dd Feb 25, 1994
36 .Dt IEEE 3
37 .Os
38 .Sh NAME
39 .Nm copysign ,
40 .Nm copysignf ,
41 .Nm finite ,
42 .Nm finitef ,
43 .Nm ilogb ,
44 .Nm ilogbf ,
45 .Nm nextafter ,
46 .Nm nextafterf ,
47 .Nm remainder ,
48 .Nm remainderf ,
49 .Nm scalbn ,
50 .Nm scalbnf
51 .Nd Functions for IEEE arithmetic
52 .Sh SYNOPSIS
53 .Fd #include <math.h>
54 .Ft double 
55 .Fn copysign "double x" "double y"
56 .Ft float 
57 .Fn copysignf "float x" "float y"
58 .Ft int 
59 .Fn finite "double x"
60 .Ft int 
61 .Fn finitef "float x"
62 .Ft int
63 .Fn ilogb "double x"
64 .Ft int
65 .Fn ilogbf "float x"
66 .Ft double 
67 .Fn nextafter "double x" "double y"
68 .Ft float
69 .Fn nextafterf "float x" "float y"
70 .Ft double
71 .Fn remainder "double x" "double y"
72 .Ft float
73 .Fn remainderf "float x" "float y"
74 .Ft double 
75 .Fn scalbn "double x" "int n"
76 .Ft float 
77 .Fn scalbnf "float x" "int n"
78 .Sh DESCRIPTION
79 These functions are required or recommended by 
80 .St -ieee754 .
81 .Pp
82 .Fn copysign
83 and
84 .Fn copysignf
85 return
86 .Fa x
87 with its sign changed to
88 .Fa y Ns 's.
89 .Pp
90 .Fn finite
91 and
92 .Fn finitef
93 return the value 1 just when
94 \-\*(If \*(Lt
95 .Fa x
96 \*(Lt +\*(If;
97 otherwise a
98 zero is returned
99 (when
100 .Pf \\*(Ba Ns Fa x Ns \\*(Ba
101 = \*(If or
102 .Fa x
103 is \*(Na
104 .Pp
105 .Fn ilogb
106 and
107 .Fn ilogbf
108 return
109 .Fa x Ns 's exponent
110 .Fa n ,
111 in integer format.
112 .Fn ilogb \*(Pm\*(If 
113 returns 
114 .Dv INT_MAX
115 and
116 .Fn ilogb 0
117 returns 
118 .Dv INT_MIN .
119 .Pp
120 .Fn nextafter 
121 and
122 .Fn nextafterf
123 return the next machine representable number from 
124 .Fa x
125 in direction
126 .Fa y .
127 .Pp
128 .Fn remainder
129 and
130 .Fn remainderf
131 return the remainder
132 .Fa r
133 :=
134 .Fa x
135 \-
136 .Fa n\(**y
137 where
138 .Fa n
139 is the integer nearest the exact value of
140 .Bk -words
141 .Fa x Ns / Ns Fa y ;
142 .Ek
143 moreover if
144 .Pf \\*(Ba Fa n
145 \-
146 .Sm off
147 .Fa x No / Fa y No \\*(Ba
148 .Sm on
149 =
150 1/2
151 then
152 .Fa n
153 is even.  Consequently
154 the remainder is computed exactly and
155 .Sm off
156 .Pf \\*(Ba Fa r No \\*(Ba
157 .Sm on
158 \*(Le
159 .Sm off
160 .Pf \\*(Ba Fa y No \\*(Ba/2.
161 .Sm on
162 But
163 .Fn remainder x 0
164 and
165 .Fn remainder \*(If 0
166 are invalid operations that produce a \*(Na.
167 .Pp
168 .Fn scalbn
169 and
170 .Fn scalbnf
171 return
172 .Fa x Ns \(**(2** Ns Fa n )
173 computed by exponent manipulation.
174 .Sh SEE ALSO
175 .Xr math 3
176 .Sh HISTORY
177 The
178 .Nm ieee
179 functions appeared in 
180 .Bx 4.3 .
181 .Sh STANDARDS
182 .St -ieee754