File: doubleRep.cpp

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (17 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// we want to make sure that we are using the doubleRep class with DOUBLEREP enabled.
#define DOUBLEREP t
#include "../doubleRep.cpp"


int main()
{
  double   d=5.352e-30;
  doubleRep k;
  k= d;
  k.output(cout);cout<<endl;
  cout << k.mantissa() <<" "<< k.expon() <<endl<<endl;

  cout <<"as double    "<<d<<endl;
  cout <<"as doubleRep "<<convert(k)<<endl;
  return(0);
}