xref: /freebsd/lib/msun/man/ilogb.3 (revision 29bf6af8904f9833bbc9c0e5f2219f785defe550)
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 January 26, 2005
36.Dt ILOGB 3
37.Os
38.Sh NAME
39.Nm ilogb ,
40.Nm ilogbf ,
41.Nm ilogbl
42.Nd extract exponent
43.Sh LIBRARY
44.Lb libm
45.Sh SYNOPSIS
46.In math.h
47.Ft int
48.Fn ilogb "double x"
49.Ft int
50.Fn ilogbf "float x"
51.Ft int
52.Fn ilogbl "long double x"
53.Sh DESCRIPTION
54.Fn ilogb ,
55.Fn ilogbf
56and
57.Fn ilogbl
58return
59.Fa x Ns 's exponent,
60in integer format.
61.Fn ilogb \*(Pm\*(If
62returns
63.Dv INT_MAX ,
64.Fn ilogb \*(Pm\*(Na
65returns
66.Dv FP_ILOGBNAN
67and
68.Fn ilogb 0
69returns
70.Dv FP_ILOGB0 .
71.Sh SEE ALSO
72.Xr frexp 3 ,
73.Xr ieee 3 ,
74.Xr math 3 ,
75.Xr scalbn 3
76.Sh STANDARDS
77The
78.Fn ilogb ,
79.Fn ilogbf ,
80and
81.Fn ilogbl
82routines conform to
83.St -isoC-99 .
84They provide functionality similar to the Logb function recommended by
85.St -ieee754 .
86.Sh HISTORY
87The
88.Fn ilogb
89and
90.Fn ilogbf
91functions appeared in
92.Bx 4.3
93and
94.Fx 2.0 ,
95respectively.
96