c/numeric/math/logb

@1-3@ Extracts the value of the unbiased radix-independent exponent from the floating-point argument, and returns it as a floating-point value. @4@ Type-generic macros: If has type,  is called. Otherwise, if has integer type or the type,  is called. Otherwise, is called.

Formally, the unbiased exponent is the signed integral part of $log r|arg|$ (returned by this function as a floating-point value), for non-zero arg, where is flt_radix. If is subnormal, it is treated as though it was normalized.

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

If a domain error occurs, an implementation-defined value is returned

If a pole error occurs, huge_val,, or is returned.

Error handling
Errors are reported as specified in.

Domain or range error may occur if is zero.

If the implementation supports IEEE floating-point arithmetic (IEC 60559),
 * If is ±0, -∞ is returned and fe_divbyzero is raised.
 * If is ±∞, +∞ is returned
 * If is NaN, NaN is returned.
 * In all other cases, the result is exact (fe_inexact is never raised) and the current rounding mode is ignored