Command:

LOGB(3) Linux Programmer's Manual LOGB(3)NAMElogb, logbf, logbl - get exponent of a floating-point valueSYNOPSIS#include<math.h>doublelogb(doublex);floatlogbf(floatx);longdoublelogbl(longdoublex);Link with-lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)):logb(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE; orcc-std=c99logbf(),logbl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; orcc-std=c99DESCRIPTIONThese 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.RETURNVALUEOn 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, respec- tively. Ifxis negative infinity or positive infinity, then positive infinity is returned.ERRORSSee math_error(7) for information on how to determine whether an error has occurred when calling these func- tions. 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.CONFORMINGTOC99, POSIX.1-2001.SEEALSOilogb(3), log(3)COLOPHONThis page is part of release 3.22 of the Linuxman-pagesproject. A description of the project, and informa- tion about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-05 LOGB(3)