]>
Commit | Line | Data |
---|---|---|
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 | |
27 | ilogb, 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 | |
37 | Link with \-lm. | |
38 | .SH DESCRIPTION | |
39 | These functions return the exponent part of their argument | |
40 | as a signed integer. When no error occurs, these functions | |
41 | are equivalent to the corresponding | |
63aa9df0 | 42 | .BR logb () |
fea681da MK |
43 | functions, cast to (int). |
44 | An error will occur for zero and infinity and NaN, | |
45 | and 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 | |
50 | In order to check for errors, set | |
51 | .I errno | |
52 | to zero and call | |
53 | .I feclearexcept(FE_ALL_EXCEPT) | |
54 | before calling these functions. On return, if | |
55 | .I errno | |
56 | is non-zero or | |
57 | .I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) | |
58 | is non-zero, an error has occurred. | |
59 | .LP | |
60 | If an error occurs and | |
61 | .I "(math_errhandling & MATH_ERRNO)" | |
62 | is non-zero, then | |
63 | .I errno | |
64 | is set to | |
65 | .BR EDOM . | |
66 | If an error occurs and | |
67 | .I "(math_errhandling & MATH_ERREXCEPT)" | |
68 | is non-zero, then the invalid floating-point exception is raised. | |
69 | .LP | |
70 | A domain error occurs when | |
71 | .I x | |
72 | is zero or infinite (or too large, or too small) or NaN. | |
73 | If | |
74 | .I x | |
75 | is zero, the constant | |
76 | .B FP_ILOGB0 | |
77 | is returned. | |
78 | .\" glibc: The numeric value is either `INT_MIN' or `-INT_MAX'. | |
79 | If | |
80 | .I x | |
81 | is NaN, the constant | |
82 | .B FP_ILOGBNAN | |
83 | is returned. | |
84 | .\" glibc: The numeric value is either `INT_MIN' or `INT_MAX'. | |
85 | If | |
86 | .I x | |
87 | is infinite (or too large), INT_MAX is returned. | |
88 | If | |
89 | .I x | |
90 | is too small, INT_MIN is returned. | |
91 | .SH "CONFORMING TO" | |
68e1685c | 92 | C99 |
fea681da MK |
93 | .SH "SEE ALSO" |
94 | .BR log (3), | |
95 | .BR logb (3) |