Name

frexp function — Computes binary fraction and exponent

Synopsis

float frexp(float x, int* exp)
double frexp(double x, int* exp)
long double frexp(long double x, int* exp)

The frexp function separates a floating-point number into a fraction and an exponent (with a base of 2) such that x = frac × 2e, in which frac is in the range [1/2, 1) or is 0 if x is 0. The exponent, e, is stored in *exp. The return value is frac. If x is 0, the return value and *exp are 0.