git-svn-id: svn://db.shs.com.ru/pip@65 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-07 07:07:57 +00:00
parent 4984ef51fc
commit 84f01c640a
4 changed files with 12 additions and 13 deletions

View File

@@ -155,8 +155,8 @@ public:
fp & operator=(const double &v) {val = FixedPoint(v).val; return *this;}
fp & operator=(const long double &v) {val = FixedPoint(v).val; return *this;}
fp & operator-() {fp p = fp(*this); p.val = -val; return p;}
bool operator==(const fp & v) const {val == v.val;}
bool operator!=(const fp & v) const {val != v.val;}
bool operator==(const fp & v) const {return val == v.val;}
bool operator!=(const fp & v) const {return val != v.val;}
void operator+=(const fp & v) {val += v.val;}
void operator-=(const fp & v) {val -= v.val;}
@@ -215,14 +215,14 @@ inline PICout operator <<(PICout s, const FixedPoint<Precision, Type> & v) {
#include "mpint.h"
//#include "mpint.h"
int main (int argc, char * argv[]) {
FixedPoint<16, long long> a, b;
/*FixedPoint<16, long long> a, b;
a = 10;
b = 3;
piCout << a << b << a/b;
FixedPoint<7,ushort> c = 507.03;
piCout << c;
piCout << c;*/
// gmp::mpint m1("1003456789098765432334567890743278908743789087345678909876543213456789098765422"),
// m2("523456789085039345678909856787656787654383071478723617832987864856248765784547826784659267894659782645824317172186776677");
// FixedPoint<1, gmp::mpint> mf1(m1);
@@ -235,7 +235,7 @@ int main (int argc, char * argv[]) {
// piCout << m1;
// piCout << tm3.elapsed_m();
//m1++;
complex<FixedPoint<8,int> > ccc;
/*complex<FixedPoint<8,int> > ccc;
piCout << ccc;
return 0;
@@ -246,7 +246,7 @@ int main (int argc, char * argv[]) {
piCout << x;
piCout << y;
piCout << z;
return 0;
return 0;*/
/*
hostent * he = 0;
he = gethostbyname(argv[1]);