Provided by: manpages-dev_3.35-0.1ubuntu1_all

**NAME**

logb, logbf, logbl - get exponent of a floating-point value

**SYNOPSIS**

#include<math.h>doublelogb(doublex);floatlogbf(floatx);longdoublelogbl(longdoublex);Link with-lm. Feature Test Macro Requirements for glibc (seefeature_test_macros(7)):logb(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; orcc-std=c99logbf(),logbl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; orcc-std=c99

**DESCRIPTION**

These functions extract the exponent from the internal floating-point representation ofxand return it as a floating-point value. The integer constantFLT_RADIX, defined in<float.h>, indicates the radix used for the system's floating-point representation. IfFLT_RADIXis 2,logb(x)is equal tofloor(log2(x)), except that it is probably faster. Ifxis subnormal,logb() returns the exponentxwould have if it were normalized.

**RETURN** **VALUE**

On success, these functions return the exponent ofx. Ifxis a NaN, a NaN is returned. Ifxis zero, then a pole error occurs, and the functions return -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively. Ifxis negative infinity or positive infinity, then positive infinity is returned.

**ERRORS**

Seemath_error(7) for information on how to determine whether an error has occurred when calling these functions. The following errors can occur: Pole error:xis 0 A divide-by-zero floating-point exception (FE_DIVBYZERO) is raised. These functions do not seterrno.

**CONFORMING** **TO**

C99, POSIX.1-2001.

**SEE** **ALSO**

ilogb(3),log(3)

**COLOPHON**

This page is part of release 3.35 of the Linuxman-pagesproject. A description of the project, and information about reporting bugs, can be found at http://man7.org/linux/man- pages/. 2010-09-20 LOGB(3)