X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fgmpint.h;h=4f45231802ba84af50d88a9db5486cf5fd24bb57;hp=11b53c53981457cc31d56d995f3d3866467b6c72;hb=e8e6ff92ef0978cbec24dd69a85dbf1bd81681ad;hpb=8c88a35a1fb0dfc9e542bb1a1c13c5f3e36eb3e5 diff --git a/src/gmpint.h b/src/gmpint.h index 11b53c5..4f45231 100644 --- a/src/gmpint.h +++ b/src/gmpint.h @@ -18,9 +18,9 @@ class Gmpint virtual ~Gmpint() {} //TODO: Do we need to delete m_op somehow? - operator int64_t() {return mpz_get_si(m_op);} - operator uint64_t() {return mpz_get_ui(m_op);} - operator double() {return mpz_get_d(m_op);} + operator int64_t() const {return mpz_get_si(m_op);} + operator uint64_t() const {return mpz_get_ui(m_op);} + operator double() const {return mpz_get_d(m_op);} std::string Str(int base = 10) const { //TODO: Make less hacky, if we care. @@ -40,8 +40,7 @@ class Gmpint Gmpint operator-(const Gmpint & sub) const {Gmpint a(*this); a -= sub; return a;} Gmpint operator*(const Gmpint & mul) const {Gmpint a(*this); a *= mul; return a;} Gmpint operator/(const Gmpint & div) const {Gmpint a(*this); a /= div; return a;} - Gmpint operator%(const Gmpint & div) const - {Gmpint a(*this); mpz_mod(a.m_op, a.m_op, div.m_op); return a;} + Gmpint operator%(const Gmpint & div) const {Gmpint a(*this); mpz_mod(a.m_op, a.m_op, div.m_op); return a;} Gmpint operator-() const {return (Gmpint(0L)-*this);}