cpp/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. @A@ Additional overloads are provided for all integer types, which are treated as.

Formally, the unbiased exponent is the signed integral part of $log r|num|$ (returned by this function as a floating-point value), for non-zero, where is  and  is the floating-point type of. 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 math_errhandling.

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.