frexp(3) Library Functions Manual frexp(3) frexp, frexpf, frexpl - / LIBRARY Math library (libm, -lm) #include double frexp(double x, int *exp); float frexpf(float x, int *exp); long double frexpl(long double x, int *exp); glibc (. feature_test_macros(7)): frexpf(), frexpl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* glibc 2.19: */ _DEFAULT_SOURCE || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE x , exp. . x , x , 1/2 () 1 ( ), [0.5,1). x , , exp. x NaN, NaN, *exp . x , , *exp . . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |frexp(), frexpf(), frexpl() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. C99, POSIX.1-2001. , double, SVr4, 4.3BSD, C89. : $ ./a.out 2560 frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560 $ ./a.out -4 frexp(-4, &e) = -0.5: -0.5 * 2^3 = -4 #include #include #include #include int main(int argc, char *argv[]) { double x, r; int exp; x = strtod(argv[1], NULL); r = frexp(x, &exp); printf("frexp(%g, &e) = %g: %g * %d^%d = %g\n", x, r, r, 2, exp, x); exit(EXIT_SUCCESS); } . ldexp(3), modf(3) Azamat Hackimov , Dmitry Bolkhovskikh , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 29 2024 . frexp(3)