ieee.3 (3a8617a83f16ffc9db4f96e1f0f21af94078e6b1) ieee.3 (7a15a32a17f4c2cbeb6f842c4c6b1cf93e4639e7)
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.

--- 16 unchanged lines hidden (view full) ---

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
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.

--- 16 unchanged lines hidden (view full) ---

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.\" $Id: ieee.3,v 1.7 1994/03/10 18:15:07 jtc Exp $
33.\" $Id: ieee.3,v 1.1.1.1 1994/08/19 09:39:42 jkh Exp $
34.\"
35.Dd Feb 25, 1994
36.Dt IEEE 3
37.Os
38.Sh NAME
39.Nm copysign ,
34.\"
35.Dd Feb 25, 1994
36.Dt IEEE 3
37.Os
38.Sh NAME
39.Nm copysign ,
40.Nm copysignf ,
40.Nm finite ,
41.Nm finite ,
42.Nm finitef ,
41.Nm ilogb ,
43.Nm ilogb ,
44.Nm ilogbf ,
42.Nm nextafter ,
45.Nm nextafter ,
46.Nm nextafterf ,
43.Nm remainder ,
47.Nm remainder ,
44.Nm scalbn
48.Nm remainderf ,
49.Nm scalbn ,
50.Nm scalbnf
45.Nd Functions for IEEE arithmetic
46.Sh SYNOPSIS
47.Fd #include <math.h>
48.Ft double
49.Fn copysign "double x" "double y"
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"
50.Ft int
51.Fn finite "double x"
58.Ft int
59.Fn finite "double x"
60.Ft int
61.Fn finitef "float x"
52.Ft int
53.Fn ilogb "double x"
62.Ft int
63.Fn ilogb "double x"
64.Ft int
65.Fn ilogbf "float x"
54.Ft double
55.Fn nextafter "double x" "double y"
66.Ft double
67.Fn nextafter "double x" "double y"
68.Ft float
69.Fn nextafterf "float x" "float y"
56.Ft double
57.Fn remainder "double x" "double y"
70.Ft double
71.Fn remainder "double x" "double y"
72.Ft float
73.Fn remainderf "float x" "float y"
58.Ft double
59.Fn scalbn "double x" "int n"
74.Ft double
75.Fn scalbn "double x" "int n"
76.Ft float
77.Fn scalbnf "float x" "int n"
60.Sh DESCRIPTION
61These functions are required or recommended by
62.St -ieee754 .
63.Pp
64.Fn copysign
78.Sh DESCRIPTION
79These functions are required or recommended by
80.St -ieee754 .
81.Pp
82.Fn copysign
65returns
83and
84.Fn copysignf
85return
66.Fa x
67with its sign changed to
68.Fa y Ns 's.
69.Pp
70.Fn finite
86.Fa x
87with its sign changed to
88.Fa y Ns 's.
89.Pp
90.Fn finite
71returns the value 1 just when
91and
92.Fn finitef
93return the value 1 just when
72\-\*(If \*(Lt
73.Fa x
74\*(Lt +\*(If;
75otherwise a
76zero is returned
77(when
78.Pf \\*(Ba Ns Fa x Ns \\*(Ba
79= \*(If or
80.Fa x
81is \*(Na
82.Pp
83.Fn ilogb
94\-\*(If \*(Lt
95.Fa x
96\*(Lt +\*(If;
97otherwise a
98zero is returned
99(when
100.Pf \\*(Ba Ns Fa x Ns \\*(Ba
101= \*(If or
102.Fa x
103is \*(Na
104.Pp
105.Fn ilogb
84returns
106and
107.Fn ilogbf
108return
85.Fa x Ns 's exponent
86.Fa n ,
87in integer format.
88.Fn ilogb \*(Pm\*(If
89returns
90.Dv INT_MAX
91and
92.Fn ilogb 0
93returns
94.Dv INT_MIN .
95.Pp
96.Fn nextafter
109.Fa x Ns 's exponent
110.Fa n ,
111in integer format.
112.Fn ilogb \*(Pm\*(If
113returns
114.Dv INT_MAX
115and
116.Fn ilogb 0
117returns
118.Dv INT_MIN .
119.Pp
120.Fn nextafter
97returns the next machine representable number from
121and
122.Fn nextafterf
123return the next machine representable number from
98.Fa x
99in direction
100.Fa y .
101.Pp
102.Fn remainder
124.Fa x
125in direction
126.Fa y .
127.Pp
128.Fn remainder
103returns the remainder
129and
130.Fn remainderf
131return the remainder
104.Fa r
105:=
106.Fa x
107\-
108.Fa n\(**y
109where
110.Fa n
111is the integer nearest the exact value of

--- 21 unchanged lines hidden (view full) ---

133.Sm on
134But
135.Fn remainder x 0
136and
137.Fn remainder \*(If 0
138are invalid operations that produce a \*(Na.
139.Pp
140.Fn scalbn
132.Fa r
133:=
134.Fa x
135\-
136.Fa n\(**y
137where
138.Fa n
139is the integer nearest the exact value of

--- 21 unchanged lines hidden (view full) ---

161.Sm on
162But
163.Fn remainder x 0
164and
165.Fn remainder \*(If 0
166are invalid operations that produce a \*(Na.
167.Pp
168.Fn scalbn
141returns
169and
170.Fn scalbnf
171return
142.Fa x Ns \(**(2** Ns Fa n )
143computed by exponent manipulation.
144.Sh SEE ALSO
145.Xr math 3
146.Sh HISTORY
147The
148.Nm ieee
149functions appeared in
150.Bx 4.3 .
151.Sh STANDARDS
152.St -ieee754
172.Fa x Ns \(**(2** Ns Fa n )
173computed by exponent manipulation.
174.Sh SEE ALSO
175.Xr math 3
176.Sh HISTORY
177The
178.Nm ieee
179functions appeared in
180.Bx 4.3 .
181.Sh STANDARDS
182.St -ieee754