diff options
author | Tim King <taking@cs.nyu.edu> | 2014-04-01 16:54:36 -0400 |
---|---|---|
committer | Tim King <taking@cs.nyu.edu> | 2014-04-01 16:54:36 -0400 |
commit | 98df8ccdd49674c02360a0662fbc1765ace2d5bf (patch) | |
tree | b80e3c78a79b45401a21a9bfb03bf63174e55199 /src/util/integer_gmp_imp.h | |
parent | e347f43940c53a8dfdaa022bc19900fcee631c08 (diff) |
Fixing bug 552. There was a bug when integers are made using a string with a lot of leading 0s on old versions of CLN.1.3.x
Diffstat (limited to 'src/util/integer_gmp_imp.h')
-rw-r--r-- | src/util/integer_gmp_imp.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index bd0556c22..a39de7996 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -60,8 +60,8 @@ public: * For more information about what is a valid rational string, * see GMP's documentation for mpq_set_str(). */ - explicit Integer(const char* s, unsigned base = 10): d_value(s, base) {} - explicit Integer(const std::string& s, unsigned base = 10) : d_value(s, base) {} + explicit Integer(const char* s, unsigned base = 10); + explicit Integer(const std::string& s, unsigned base = 10); Integer(const Integer& q) : d_value(q.d_value) {} @@ -149,7 +149,7 @@ public: mpz_and(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t()); return Integer(result); } - + Integer bitwiseXor(const Integer& y) const { mpz_class result; mpz_xor(result.get_mpz_t(), d_value.get_mpz_t(), y.d_value.get_mpz_t()); @@ -161,7 +161,7 @@ public: mpz_com(result.get_mpz_t(), d_value.get_mpz_t()); return Integer(result); } - + /** * Return this*(2^pow). */ @@ -171,20 +171,20 @@ public: return Integer( result ); } - /** + /** * Returns the Integer obtained by setting the ith bit of the - * current Integer to 1. + * current Integer to 1. */ Integer setBit(uint32_t i) const { mpz_class res = d_value; mpz_setbit(res.get_mpz_t(), i); - return Integer(res); + return Integer(res); } bool isBitSet(uint32_t i) const { - return !extractBitRange(1, i).isZero(); + return !extractBitRange(1, i).isZero(); } - + /** * Returns the integer with the binary representation of size bits * extended with amount 1's |