From ea8139dc7b727bf48bd7b7c6b169d763618a1f2a Mon Sep 17 00:00:00 2001 From: Tim King Date: Fri, 18 May 2012 23:48:38 +0000 Subject: This commit adds TypeNode::leastCommonTypeNode(). The special case for arithmetic in TypeNode::operator==() has been removed. A number of faulty type checking checks were switched to use isSubtypeOf. The resolves bug #339 --- src/util/integer_gmp_imp.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/util/integer_gmp_imp.h') diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index 74b4adad0..f5254a3d2 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -400,10 +400,20 @@ public: } static void extendedGcd(Integer& g, Integer& s, Integer& t, const Integer& a, const Integer& b){ + //see the documentation for: //mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, mpz_t a, mpz_t b); mpz_gcdext (g.d_value.get_mpz_t(), s.d_value.get_mpz_t(), t.d_value.get_mpz_t(), a.d_value.get_mpz_t(), b.d_value.get_mpz_t()); } + /** Returns a reference to the minimum of two integers. */ + static const Integer& min(const Integer& a, const Integer& b){ + return (a <=b ) ? a : b; + } + + /** Returns a reference to the maximum of two integers. */ + static const Integer& max(const Integer& a, const Integer& b){ + return (a >= b ) ? a : b; + } friend class CVC4::Rational; };/* class Integer */ -- cgit v1.2.3