1ilogb(3M)               Mathematical Library Functions               ilogb(3M)
2
3
4

NAME

6       ilogb, ilogbf, ilogbl - return an unbiased exponent
7

SYNOPSIS

9       c99 [ flag... ] file... -lm [ library... ]
10       #include <math.h>
11
12       int ilogb(double x);
13
14
15       int ilogbf(float x);
16
17
18       int ilogbl(long double x);
19
20
21       cc [ flag... ] file... -lm [ library... ]
22       #include <math.h>
23
24       int ilogb(double x);
25
26
27       int ilogbf(float x);
28
29
30       int ilogbl(long double x);
31
32

DESCRIPTION

34       These  functions  return  the  exponent part of their argument x.  For‐
35       mally, the return value is the integral part  of   log(r)|  x  |  as  a
36       signed  integral  value,  for  non-zero  x, where r is the radix of the
37       machine's floating point arithmetic, which is the  value  of  FLT_RADIX
38       defined in <float.h>.
39

RETURN VALUES

41       Upon successful completion, these functions return the exponent part of
42       x as a signed integer value. They are equivalent to calling the  corre‐
43       sponding logb(3M) function and casting the returned value to type int.
44
45
46       If x is 0, the value FP_ILOGB0 is returned. For SUSv3-conforming appli‐
47       cations compiled with the c99 compiler  driver  (see  standards(5)),  a
48       domain error occurs.
49
50
51       If  x  is  ±Inf,  the  value  INT_MAX is returned. For SUSv3-conforming
52       applications compiled with the c99  compiler  driver,  a  domain  error
53       occurs.
54
55
56       If  x  is  NaN, the value FP_ILOGBNAN is returned. For SUSv3-conforming
57       applications compiled with the c99  compiler  driver,  a  domain  error
58       occurs.
59

ERRORS

61       These functions will fail if:
62
63       Domain Error    The x argument is zero, NaN, or ±Inf.
64
65                       If   the   integer   expression   (math_errhandling   &
66                       MATH_ERREXCEPT) is non-zero, then the invalid floating-
67                       point exception is raised.
68
69

ATTRIBUTES

71       See attributes(5) for descriptions of the following attributes:
72
73
74
75
76       ┌─────────────────────────────┬─────────────────────────────┐
77       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
78       ├─────────────────────────────┼─────────────────────────────┤
79       │Interface Stability          │Standard                     │
80       ├─────────────────────────────┼─────────────────────────────┤
81       │MT-Level                     │MT-Safe                      │
82       └─────────────────────────────┴─────────────────────────────┘
83

SEE ALSO

85       feclearexcept(3M),    fetestexcept(3M),    limits.h(3HEAD),   logb(3M),
86       math.h(3HEAD), scalb(3M), attributes(5), standards(5)
87
88
89
90SunOS 5.11                        12 Jul 2006                        ilogb(3M)
Impressum