]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ilogb.3
sync
[thirdparty/man-pages.git] / man3 / ilogb.3
CommitLineData
fea681da
MK
1.\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
11.\"
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
19.\"
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
23.\" Inspired by a page by Walter Harms created 2002-08-10
24.\"
25.TH ILOGB 3 2004-10-31 "" "Linux Programmer's Manual"
26.SH NAME
27ilogb, ilogbf, ilogbl \- get integer exponent of a floating point value
28.SH SYNOPSIS
29.B #include <math.h>
30.sp
31.BI "int ilogb(double " x );
32.br
33.BI "int ilogbf(float " x );
34.br
35.BI "int ilogbl(long double " x );
36.sp
37Link with \-lm.
38.SH DESCRIPTION
39These functions return the exponent part of their argument
40as a signed integer. When no error occurs, these functions
41are equivalent to the corresponding
63aa9df0 42.BR logb ()
fea681da
MK
43functions, cast to (int).
44An error will occur for zero and infinity and NaN,
45and possibly for overflow.
46.\" .SH "RETURN VALUE"
47.\" These functions return the exponent part of their argument
48.\" as a signed integer.
49.SH ERRORS
50In order to check for errors, set
51.I errno
52to zero and call
53.I feclearexcept(FE_ALL_EXCEPT)
54before calling these functions. On return, if
55.I errno
56is non-zero or
57.I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
58is non-zero, an error has occurred.
59.LP
60If an error occurs and
61.I "(math_errhandling & MATH_ERRNO)"
62is non-zero, then
63.I errno
64is set to
65.BR EDOM .
66If an error occurs and
67.I "(math_errhandling & MATH_ERREXCEPT)"
68is non-zero, then the invalid floating-point exception is raised.
69.LP
70A domain error occurs when
71.I x
72is zero or infinite (or too large, or too small) or NaN.
73If
74.I x
75is zero, the constant
76.B FP_ILOGB0
77is returned.
78.\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'.
79If
80.I x
81is NaN, the constant
82.B FP_ILOGBNAN
83is returned.
84.\" glibc: The numeric value is either `INT_MIN' or `INT_MAX'.
85If
86.I x
87is infinite (or too large), INT_MAX is returned.
88If
89.I x
90is too small, INT_MIN is returned.
91.SH "CONFORMING TO"
68e1685c 92C99
fea681da
MK
93.SH "SEE ALSO"
94.BR log (3),
95.BR logb (3)