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 || /* glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE These functions extract the exponent from the internal floating-point representation of x and return it as a floating-point value. The integer constant FLT_RADIX, defined in , indicates the radix used for the system's floating-point representation. If FLT_RADIX is 2, logb(x) is similar to floor(log2(fabs(x))), except that the latter may give an incorrect integer due to intermediate rounding. x , logb() x , . x. x NaN, NaN. x , , -HUGE_VAL, -HUGE_VALF -HUGE_VALL, . x , . math_error(7), , . : : x 0 (FE_DIVBYZERO). errno. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |logb(), logbf(), logbl() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. C99, POSIX.1-2001. logb() 4.3BSD (see IEEE.3 in the 4.3BSD manual). ilogb(3), log(3) () Artyom Kunyov , Azamat Hackimov , Dmitry Bolkhovskikh , Katrin Kutepova , Konstantin Shvaykovskiy , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 2 2024 . logb(3)