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.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.