frexp() and frexpf()

Syntax
  #include <math.h>

  
  double frexp(double x, int *exp);

  
  float  frexpf(float x, int *exp);

  
Description

frexp() splits a floating point number into mantissa and exponent. The relation is x = m * 2^exp. m always normalizes to the range 0.5 < m <= 1.0. The mantissa has the same sign as x.

Return

The mantissa of x (the exponent is written to *exp). If x is 0.0, both the mantissa (the return value) and the exponent are 0.

See also

exp() and expf()

ldexp() and ldexpf()

modf() and modff()