1ILOGB(3)                   Linux Programmer's Manual                  ILOGB(3)
2
3
4

NAME

6       ilogb, ilogbf, ilogbl - get integer exponent of a floating-point value
7

SYNOPSIS

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():
20           _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
21           _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE ||
22           _POSIX_C_SOURCE >= 200112L;
23           or cc -std=c99
24       ilogbf(), ilogbl():
25           _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 ||
26           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L;
27           or cc -std=c99
28

DESCRIPTION

30       These functions return the exponent part of their argument as a  signed
31       integer.   When  no error occurs, these functions are equivalent to the
32       corresponding logb(3) functions, cast to int.
33

RETURN VALUE

35       On success, these functions return the exponent of x, as a signed inte‐
36       ger.
37
38       If  x  is  zero,  then  a domain error occurs, and the functions return
39       FP_ILOGB0.
40
41       If x is a NaN, then a domain error occurs,  and  the  functions  return
42       FP_ILOGBNAN.
43
44       If  x  is  negative  infinity or positive infinity, then a domain error
45       occurs, and the functions return INT_MAX.
46

ERRORS

48       See math_error(7) for information on how to determine whether an  error
49       has occurred when calling these functions.
50
51       The following errors can occur:
52
53       Domain error: x is 0 or a NaN
54              An invalid floating-point exception (FE_INVALID) is raised.
55
56              These functions do not set errno for this case.
57
58       Domain error: x is an infinity
59
60              These  functions do not set errno or raise an exception for this
61              case.
62

CONFORMING TO

64       C99, POSIX.1-2001.
65

SEE ALSO

67       log(3), logb(3), significand(3)
68

COLOPHON

70       This page is part of release 3.53 of the Linux  man-pages  project.   A
71       description  of  the project, and information about reporting bugs, can
72       be found at http://www.kernel.org/doc/man-pages/.
73
74
75
76                                  2010-09-20                          ILOGB(3)
Impressum