frexp(3) Library Functions Manual frexp(3) frexp, frexpf, frexpl - (libm -lm) #include double frexp(double x, int *e); float frexpf(float x, int *e); long double frexpl(long double x, int *e); glibc ( feature_test_macros(7)): frexpf(), frexpl(): _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || /* Since glibc 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE x e. . x x 2 1/2 () 1 ( ) [0.5,1). x e. x NaN NaN *e . x ( ) ( ) *e . . attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |frexp(), | | MT-Safe | |frexpf(), | | | |frexpl() | | | +------------+------------------------------------+--------------------+ 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 e; x = strtod(argv[1], NULL); r = frexp(x, &e); printf("frexp(%g, &e) = %g: %g * %d^%d = %g\n", x, r, r, 2, e, x); exit(EXIT_SUCCESS); } ldexp(3), modf(3) 3 . . : . 6.18 8 2026 frexp(3)