c/numeric/math/ilogb

@1-3@ Extracts the value of the unbiased exponent from the floating-point argument, and returns it as a signed integer value. @4@ Type-generic macros: If has type,  is called. Otherwise, if has integer type or the type,  is called. Otherwise, is called. @5@ Expands to integer constant expression whose value is either int_min or. @6@ Expands to integer constant expression whose value is either int_min or.

Formally, the unbiased exponent is the integral part of $log r|arg|$ as a signed integral value, for non-zero arg, where is flt_radix.

Return value
If no errors occur, the unbiased exponent of is returned as a signed int value.

If is zero, fp_ilogb0 is returned.

If is infinite, int_max is returned.

If is a NaN, fp_ilogbnan is returned.

If the correct result is greater than int_max or smaller than int_min, the return value is unspecified and a domain error or range error may occur

Error handling
Errors are reported as specified in math_errhandling.

A domain error or range error may occur if is zero, infinite, or NaN.

If the correct result is greater than int_max or smaller than int_min, a domain error or a range error may occur

If the implementation supports IEEE floating-point arithmetic (IEC 60559),
 * If the correct result is greater than int_max or smaller than int_min, fe_invalid is raised.
 * If is ±0, ±∞, or NaN, fe_invalid is raised.
 * In all other cases, the result is exact (fe_inexact is never raised) and the current rounding mode is ignored