FREXP(3) Library Functions Manual FREXP(3)

frexpbreak floating-point number into normalized fraction and power of 2

#include <math.h>

double
frexp(double value, int *exp);

long double
frexpl(long double value, int *exp);

float
frexpf(float value, int *exp);

The () functions break the floating-point number value into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.

The functions return a number x such that x has a magnitude in the interval [1/2, 1) or 0, and value = x*(2**exp).

(±0, exp) returns ±0, and stores 0 in the object pointed to by exp.

(±infinity, exp) returns ±infinity, and stores an unspecified value in the object pointed to by exp.

(Nan, exp) returns a Nan, and stores an unspecified value in the object pointed to by exp.

math(3), scalbn

The frexp() functions conform to ISO/IEC 9899:2011.

December 11, 2006 macOS 15.2