logb(3) Library Functions Manual logb(3) logb, logbf, logbl - (libm -lm) #include double logb(double x); float logbf(float x); long double logbl(long double x); glibc ( feature_test_macros(7)): logb(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 500 || /* glibc 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE logbf(), logbl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE x . FLT_RADIX . FLT_RADIX 2 logb(x) floor(log2(fabs(x))), . x logb() x . x. x (NaN) NaN. x (pole error) -HUGE_VAL -HUGE_VALF -HUGE_VALL . x . math_error(7) . : : x 0 (FE_DIVBYZERO). errno. attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |logb(), | | MT-Safe | |logbf(), | | | |logbl() | | | +------------+------------------------------------+--------------------+ C11, POSIX.1-2008. C99 POSIX.1-2001. logb() 4.3BSD ( IEEE.3 4.3BSD). ilogb(3), log(3) 3 . . : . 6.18 8 2026 logb(3)