User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







cpp:cmath:frexp

Table of Contents

frexp

    double frexp(double);

Mantissa m. in *n is the exponent.

cpp Sourcecode Example

#include <iostream> /* including standard library */
#include <cmath> /* including math library */
 
using namespace std;
int main ( void ) 
{
  double x;
  int n;
 
  x = 42.0;
 
  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);
 
  cout << frexp (x, &n) << " * 2^" << n << " = " << x << endl;
  return 0;
}

output

   0.65625 * 2^0 = 42
advertising
cpp/cmath/frexp.txt · Last modified: 2012/10/12 18:35 (external edit)

Impressum Datenschutz