Calculates the fractional and exponent parts of a double value.
#include <math.h> double frexp (double value, int *eptr);
value = fraction * (2exp)
The fractional part is returned as the return value. The exponent is placed in the integer variable pointed to by eptr.
main () { double val = 16.0, fraction; int exp; fraction = frexp(val, &exp); printf("fraction = %f\n",fraction); printf("exp = %d\n",exp); }
In this example, frexp converts the value 16 to .5*2 5 . The example produces the following output:
fraction = 0.500000 exp = 5
x | The fractional part of the double value. |