ilogb, ilogbf, ilogbl - get integer exponent of a floating-point value
#include <math.h>
int ilogb(double x
);
int ilogbf(float x
);
int ilogbl(long double x
);
Link with -lm
.
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
These functions return the exponent part of their argument as a signed integer. When no error occurs, these functions are equivalent to the corresponding logb(3) functions, cast to int
.
On success, these functions return the exponent of x
, as a signed integer.
If x
is zero, then a domain error occurs, and the functions return FP_ILOGB0.
If x
is a NaN, then a domain error occurs, and the functions return FP_ILOGBNAN.
If x
is negative infinity or positive infinity, then a domain error occurs, and the functions return INT_MAX.
log(3), logb(3), significand(3)