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           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21               || _XOPEN_SOURCE >= 500
22               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23               || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24       ilogbf(), ilogbl():
25           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
26               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
27               || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
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,  and
55              errno is set to EDOM (but see BUGS).
56
57       Domain error: x is an infinity
58              An  invalid floating-point exception (FE_INVALID) is raised, and
59              errno is set to EDOM (but see BUGS).
60

ATTRIBUTES

62       For  an  explanation  of  the  terms  used   in   this   section,   see
63       attributes(7).
64
65       ┌────────────────────────────┬───────────────┬─────────┐
66Interface                   Attribute     Value   
67       ├────────────────────────────┼───────────────┼─────────┤
68ilogb(), ilogbf(), ilogbl() │ Thread safety │ MT-Safe │
69       └────────────────────────────┴───────────────┴─────────┘

CONFORMING TO

71       C99, POSIX.1-2001, POSIX.1-2008.
72

BUGS

74       Before  version 2.16, the following bugs existed in the glibc implemen‐
75       tation of these functions:
76
77       *  The domain error case where x is 0 or a NaN did not cause  errno  to
78          be set or (on some architectures) raise a floating-point exception.
79
80       *  The  domain error case where x is an infinity did not cause errno to
81          be set or raise a floating-point exception.
82

SEE ALSO

84       log(3), logb(3), significand(3)
85

COLOPHON

87       This page is part of release 4.15 of the Linux  man-pages  project.   A
88       description  of  the project, information about reporting bugs, and the
89       latest    version    of    this    page,    can     be     found     at
90       https://www.kernel.org/doc/man-pages/.
91
92
93
94                                  2017-09-15                          ILOGB(3)
Impressum