diff options
Diffstat (limited to 'src/util/integer_gmp_imp.h')
-rw-r--r-- | src/util/integer_gmp_imp.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index ceb585852..74b4adad0 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -276,6 +276,18 @@ public: return mpz_sgn(d_value.get_mpz_t()); } + bool isZero() const { + return sgn() == 0; + } + + bool isOne() const { + return mpz_cmp_si(d_value.get_mpz_t(), 1) == 0; + } + + bool isNegativeOne() const { + return mpz_cmp_si(d_value.get_mpz_t(), -1) == 0; + } + /** * Raise this Integer to the power <code>exp</code>. * |