1ILOGB(3) Linux Programmer's Manual ILOGB(3)
2
3
4
6 ilogb, ilogbf, ilogbl - get integer exponent of a floating-point value
7
9 #include <math.h>
10
11 int ilogb(double x);
12 int ilogbf(float x);
13 int ilogbl(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 ilogb(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
20 _ISOC99_SOURCE; or cc -std=c99
21 ilogbf(), ilogbl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
22 || _ISOC99_SOURCE; or cc -std=c99
23
25 These functions return the exponent part of their argument as a signed
26 integer. When no error occurs, these functions are equivalent to the
27 corresponding logb(3) functions, cast to int.
28
30 On success, these functions return the exponent of x, as a signed inte‐
31 ger.
32
33 If x is zero, then a domain error occurs, and the functions return
34 FP_ILOGB0.
35
36 If x is a NaN, then a domain error occurs, and the functions return
37 FP_ILOGBNAN.
38
39 If x is negative infinity or positive infinity, then a domain error
40 occurs, and the functions return INT_MAX.
41
43 See math_error(7) for information on how to determine whether an error
44 has occurred when calling these functions.
45
46 The following errors can occur:
47
48 Domain error: x is 0 or a NaN
49 An invalid floating-point exception (FE_INVALID) is raised.
50
51 These functions do not set errno for this case.
52
53 Domain error: x is an infinity
54
55 These functions do not set errno or raise an exception for this
56 case.
57
59 C99, POSIX.1-2001.
60
62 log(3), logb(3), significand(3)
63
65 This page is part of release 3.22 of the Linux man-pages project. A
66 description of the project, and information about reporting bugs, can
67 be found at http://www.kernel.org/doc/man-pages/.
68
69
70
71 2009-02-04 ILOGB(3)