C Tutorial/math.h/frexp

Материал из C\C++ эксперт
Перейти к: навигация, поиск

frexp

Item Value Header file math.h Declaration float frexpf(float num, int *exp);double frexp(double num, int *exp);long double frexpl(long double num, int *exp); Function decomposes the num into a mantissa in the range 0.5 to less than 1, and an integer exponent such that num = mantissa * 2^exp. Return The mantissa is returned by the function, and the exponent is stored at the variable pointed to by exp.


#include <math.h>
  #include <stdio.h>
  int main(void)
  {
     int e;
     double f;
     f = frexp(10.0, &e);
     printf("%f %d", f, e);
 
  }