- bool operator<(ParanoidNumber & a) {return ToDouble() < a.ToDouble();}
- bool operator<=(ParanoidNumber & a) {return this->operator<(a) || this->operator==(a);}
- bool operator>(ParanoidNumber & a) {return !(this->operator<=(a));}
- bool operator>=(ParanoidNumber & a) {return !(this->operator<(a));}
- bool operator==(ParanoidNumber & a) {return ToDouble() == a.ToDouble();}
- bool operator!=(ParanoidNumber & a) {return !(this->operator==(a));}
+
+ // None of these are actually const
+ bool operator<(const ParanoidNumber & a) const {return ToDouble() < a.ToDouble();}
+ bool operator<=(const ParanoidNumber & a) const {return this->operator<(a) || this->operator==(a);}
+ bool operator>(const ParanoidNumber & a) const {return !(this->operator<=(a));}
+ bool operator>=(const ParanoidNumber & a) const {return !(this->operator<(a));}
+ bool operator==(const ParanoidNumber & a) const {return ToDouble() == a.ToDouble();}
+ bool operator!=(const ParanoidNumber & a) const {return !(this->operator==(a));}
+
+ ParanoidNumber operator-() const
+ {
+ ParanoidNumber neg(0);
+ neg -= *this;
+ return neg;
+ }