You are here : cpp0frexp

frexp() - 0

The C library function double frexp(double x, int *exponent) return value is the mantissa, and the integer pointed to by exponent is the exponent. The resultant value is x = mantissa * 2 ^ exponent.


Syntax

double frexp(double x, int *exponent)


Example

#include <stdio.h>
#include <math.h>

int main ()
{
   double x = 1024, fraction;
   int e;
   
   fraction = frexp(x, &e);
   printf("x = %.2lf = %.2lf * 2^%d\n", x, fraction, e);
   
   return(0);
}


Output / Return Value

x = 1024.00 = 0.50 * 2^11


Limitations


Alternatives / See Also


Reference