ilogb.3 (ee7093a6400feef3d8a99579f28577817d70f6ad) ilogb.3 (6821aba9e5245f0e9c9fe53c67b77dd117307005)
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.

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

23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
29.\" $FreeBSD$
30.\"
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.

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

23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" from: @(#)ieee.3 6.4 (Berkeley) 5/6/91
29.\" $FreeBSD$
30.\"
31.Dd November 6, 2005
31.Dd December 16, 2007
32.Dt ILOGB 3
33.Os
34.Sh NAME
35.Nm ilogb ,
36.Nm ilogbf ,
37.Nm ilogbl ,
38.Nm logb ,
32.Dt ILOGB 3
33.Os
34.Sh NAME
35.Nm ilogb ,
36.Nm ilogbf ,
37.Nm ilogbl ,
38.Nm logb ,
39.Nm logbf
39.Nm logbf ,
40.Nm logbl
40.Nd extract exponent
41.Sh LIBRARY
42.Lb libm
43.Sh SYNOPSIS
44.In math.h
45.Ft int
46.Fn ilogb "double x"
47.Ft int
48.Fn ilogbf "float x"
49.Ft int
50.Fn ilogbl "long double x"
51.Ft double
52.Fn logb "double x"
53.Ft float
54.Fn logbf "float x"
41.Nd extract exponent
42.Sh LIBRARY
43.Lb libm
44.Sh SYNOPSIS
45.In math.h
46.Ft int
47.Fn ilogb "double x"
48.Ft int
49.Fn ilogbf "float x"
50.Ft int
51.Fn ilogbl "long double x"
52.Ft double
53.Fn logb "double x"
54.Ft float
55.Fn logbf "float x"
56.Ft long double
57.Fn logbl "long double x"
55.Sh DESCRIPTION
56.Fn ilogb ,
57.Fn ilogbf
58and
59.Fn ilogbl
60return
61.Fa x Ns 's exponent
62in integer format.
63.Fn ilogb \*(Pm\*(If
64returns
65.Dv INT_MAX ,
66.Fn ilogb \*(Pm\*(Na
67returns
68.Dv FP_ILOGBNAN ,
69and
70.Fn ilogb 0
71returns
72.Dv FP_ILOGB0 .
73.Pp
58.Sh DESCRIPTION
59.Fn ilogb ,
60.Fn ilogbf
61and
62.Fn ilogbl
63return
64.Fa x Ns 's exponent
65in integer format.
66.Fn ilogb \*(Pm\*(If
67returns
68.Dv INT_MAX ,
69.Fn ilogb \*(Pm\*(Na
70returns
71.Dv FP_ILOGBNAN ,
72and
73.Fn ilogb 0
74returns
75.Dv FP_ILOGB0 .
76.Pp
74.Fn logb x
77.Fn logb x ,
78.Fn logbf x ,
75and
79and
76.Fn logbf x
80.Fn logbl x
77return
78.Fa x Ns 's exponent
79in floating\-point format with the same precision as
80.Fa x .
81.Fn logb \*(Pm\*(If
82returns +\*(If, and
83.Fn logb 0
84returns -\*(If with a division by zero exception.
85.Sh SEE ALSO
86.Xr frexp 3 ,
87.Xr ieee 3 ,
88.Xr math 3 ,
89.Xr scalbn 3
90.Sh STANDARDS
91The
92.Fn ilogb ,
93.Fn ilogbf ,
94.Fn ilogbl ,
81return
82.Fa x Ns 's exponent
83in floating\-point format with the same precision as
84.Fa x .
85.Fn logb \*(Pm\*(If
86returns +\*(If, and
87.Fn logb 0
88returns -\*(If with a division by zero exception.
89.Sh SEE ALSO
90.Xr frexp 3 ,
91.Xr ieee 3 ,
92.Xr math 3 ,
93.Xr scalbn 3
94.Sh STANDARDS
95The
96.Fn ilogb ,
97.Fn ilogbf ,
98.Fn ilogbl ,
95.Fn logb
99.Fn logb ,
100.Fn logbf ,
96and
101and
97.Fn logbf
102.Fn logbl
98routines conform to
99.St -isoC-99 .
103routines conform to
104.St -isoC-99 .
100.Fn logb
101and
102.Fn logbf
105The latter three
103implement the logb function recommended by
104.St -ieee754 .
105.Sh HISTORY
106implement the logb function recommended by
107.St -ieee754 .
108.Sh HISTORY
106The
107.Fn logb
108function appeared in
109.Bx 4.3 .
110The
111.Fn ilogb
112function appeared in
113.Fx 1.1.5 .
114The
115.Fn ilogbf
116and
117.Fn logbf
118functions appeared in
119.Fx 2.0 .
120The
121.Fn ilogbl
122function appeared in
123.Fx 5.4 .
109.Bl -tag -width "Function " -compact
110.It Em Function
111.Em "First Appeared In"
112.It Fn logb
113.Bx 4.3
114.It Fn ilogb
115.Fx 1.1.5
116.It Fn ilogbf
117.Fx 2.0
118.It Fn logbf
119.Fx 2.0
120.It Fn ilogbl
121.Fx 5.4
122.It Fn logbl
123.Fx 8.0
124.El