LOGB(3) Library Functions Manual LOGB(3)

logbradix-independent exponent

#include <math.h>

double logb(double x);

The logb() function computes the exponent of x , which is the integral part of log r | x | , as a signed floating point value, for non-zero x , where r is the radix of the machine's floating-point arithmetic.

Upon successful completion, logb() returns the exponent of x .

If x is 0.0, logb() returns -HUGE_VAL and sets errno to [EDOM].

If x is ±Inf, logb() returns +Inf.

If x is NaN, logb() returns NaN and may set errno to [EDOM].

The logb() function will fail if:

The x argument is 0.0.

The logb() function may fail if:

The x argument is NaN.

None.

None.

None.

ilogb(3) , <math.h> .

February 1997 posix.fail