slerena 8594b9936c 012-05-05 Sancho Lerena <slerena@artica.es>
* anytermd: Added anyterm to extras. Included modifications on original
	anytermd project source code. Added a new spec file for centos/fedora/rhel.
	Tested on FC16/i386 and centos6/x86_84.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6257 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-05-04 19:14:27 +00:00

43 lines
857 B
C++

#include <iostream>
#include "fixed.hh"
#include "safe_int.hh"
using namespace std;
using namespace pbe;
typedef pbe::fixed<16,8> f1;
typedef pbe::fixed<16,10> f2;
int main(int argc, char* argv[])
{
f1 a;
f2 b;
f1 c;
f2 d;
pbe::fixed<24,26> e;
a = 0.25;
b = 128;
c = a+b;
d = c * a;
e = d / a;
cout << "a=" << static_cast<double>(a) << " (a.val = " << a.val << ")\n";
cout << "b=" << static_cast<double>(b) << " (b.val = " << b.val << ")\n";
cout << "c=" << static_cast<double>(c) << " (c.val = " << c.val << ")\n";
cout << "d=" << static_cast<double>(d) << " (d.val = " << d.val << ")\n";
cout << "e=" << static_cast<double>(e) << " (e.val = " << e.val << ")\n";
typedef pbe::fixed<8,5,pbe::safe_int<13> > f_t;
f_t f;
f = a;
while (1) {
f = f+f;
cout << "f=" << static_cast<double>(f) << "\n";
}
}