X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Frational.h;h=bbd4c30dcb3171882706b785dff43070857d1c8b;hp=595f5f25288c4ac87e9ccbce733a7f248cc2531e;hb=8e0633d24356301c335c20de8ab0865331b91fdb;hpb=46fa3e99a49b47c18836d44d806971192907c304 diff --git a/src/rational.h b/src/rational.h index 595f5f2..bbd4c30 100644 --- a/src/rational.h +++ b/src/rational.h @@ -162,7 +162,7 @@ struct Rational //Rational operator*(const Rational & r) const {return Rational(ToDouble()*r.ToDouble());} //Rational operator/(const Rational & r) const {return Rational(ToDouble()/r.ToDouble());} - Rational operator-() const {Rational r(*this); r.P = -r.P;} + Rational operator-() const {Rational r(*this); r.P = -r.P; return r;} Rational & operator=(const Rational & r) {P = r.P; Q = r.Q; Simplify(); return *this;} Rational & operator+=(const Rational & r) {this->operator=(*this+r); return *this;} Rational & operator-=(const Rational & r) {this->operator=(*this-r); return *this;}