diff options
Diffstat (limited to 'src/util/integer_gmp_imp.h')
-rw-r--r-- | src/util/integer_gmp_imp.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index 72a653545..13bed50b3 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -155,6 +155,16 @@ public: return gmpz_hash(d_value.get_mpz_t()); } + /** + * Returns true iff bit n is set. + * + * @param n the bit to test (0 == least significant bit) + * @return true if bit n is set in this integer; false otherwise + */ + bool testBit(unsigned n) const { + return mpz_tstbit(d_value.get_mpz_t(), n); + } + friend class CVC4::Rational; };/* class Integer */ @@ -171,4 +181,3 @@ inline std::ostream& operator<<(std::ostream& os, const Integer& n) { }/* CVC4 namespace */ #endif /* __CVC4__INTEGER_H */ - |