Functions HI-TECH C FREXP

FREXP, LDEXP

SYNOPSIS

#include  <math.h>

double    frexp(double f, int * p)

double    ldexp(double f, int i)


DESCRIPTION

Frexp() breaks a floating point number into a normalized fraction and an integral power of 2. The integer is stored into the int object pointed to by p. Its return value x is in the interval [0.5, 1.0) or zero, and f equals x times 2 raised to the power stored in

  • p. If f is zero, both parts of the result are zero.

Ldexp() performs the reverse operation; the integer i is added to the exponent of the floating point f and the resultant value returned.