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

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
cpp/cmath/frexp.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz