From 368325e53cee7c1f9a91e2c06b47240149131f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Wed, 15 Apr 2015 14:25:08 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@103 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/math/pifixedpoint.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/math/pifixedpoint.h b/src/math/pifixedpoint.h index 1054f814..8d047eaf 100644 --- a/src/math/pifixedpoint.h +++ b/src/math/pifixedpoint.h @@ -36,26 +36,26 @@ public: // FixedPoint(const long double &v) {val = Precision == 0 ? Type(v) : Type(v * (2 << Precision-1));} template - fp & operator=(const T & v) {val = fpv(Type(v)); return *this;} - fp & operator=(const fp & v) {val = v.val; return *this;} - fp & operator=(const float &v) {val = PIFixedPoint(v).val; return *this;} - fp & operator=(const double &v) {val = PIFixedPoint(v).val; return *this;} - fp & operator=(const long double &v) {val = PIFixedPoint(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;} + fp & operator =(const T & v) {val = fpv(Type(v)); return *this;} + fp & operator =(const fp & v) {val = v.val; return *this;} + fp & operator =(const float &v) {val = PIFixedPoint(v).val; return *this;} + fp & operator =(const double &v) {val = PIFixedPoint(v).val; return *this;} + fp & operator =(const long double &v) {val = PIFixedPoint(v).val; return *this;} + fp & operator -() {fp p = fp(*this); p.val = -val; return p;} + 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;} + void operator +=(const fp & v) {val += v.val;} + void operator -=(const fp & v) {val -= v.val;} - void operator*=(const fp & v) {val = fpi(val *v.val);} - void operator/=(const fp & v) {val = fpv(val) / v.val;} + void operator *=(const fp & v) {val = fpi(val *v.val);} + void operator /=(const fp & v) {val = fpv(val) / v.val;} - fp operator+(const fp & v) {fp p = fp(*this); p.val += v.val; return p;} - fp operator-(const fp & v) {fp p = fp(*this); p.val -= v.val; return p;} + fp operator +(const fp & v) {fp p = fp(*this); p.val += v.val; return p;} + fp operator -(const fp & v) {fp p = fp(*this); p.val -= v.val; return p;} - fp operator*(const fp & v) {fp p; p.val = fpi(val * v.val); return p;} - fp operator/(const fp & v) {fp p; p.val = fpv(val) / v.val; return p;} + fp operator *(const fp & v) {fp p; p.val = fpi(val * v.val); return p;} + fp operator /(const fp & v) {fp p; p.val = fpv(val) / v.val; return p;} /*fp & operator =(const Type & v) {val = fpv(v); return *this;} bool operator ==(const Type & v) const {val == fpv(v);}