mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
adding review notes to code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
9903c722af
7 changed files with 215 additions and 103 deletions
|
@ -155,6 +155,17 @@ class inf_int_rational {
|
|||
return *this;
|
||||
}
|
||||
|
||||
inf_int_rational & operator*=(const rational & r) {
|
||||
if (!r.is_int32()) {
|
||||
throw default_exception("multiplication with large rational is not possible");
|
||||
}
|
||||
m_first *= r;
|
||||
m_second *= r.get_int32();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inf_int_rational & operator-=(const inf_int_rational & r) {
|
||||
m_first -= r.m_first;
|
||||
m_second -= r.m_second;
|
||||
|
@ -344,6 +355,10 @@ inline inf_int_rational operator+(const inf_int_rational & r1, const inf_int_rat
|
|||
return inf_int_rational(r1) += r2;
|
||||
}
|
||||
|
||||
inline inf_int_rational operator*(const rational & r1, const inf_int_rational & r2) {
|
||||
return inf_int_rational(r2) *= r1;
|
||||
}
|
||||
|
||||
inline inf_int_rational operator-(const inf_int_rational & r1, const inf_int_rational & r2) {
|
||||
return inf_int_rational(r1) -= r2;
|
||||
}
|
||||
|
|
|
@ -111,6 +111,11 @@ public:
|
|||
return INT_MIN <= v && v <= INT_MAX;
|
||||
}
|
||||
|
||||
int get_int32() const {
|
||||
SASSERT(is_int32());
|
||||
return (int)get_int64();
|
||||
}
|
||||
|
||||
double get_double() const { return m().get_double(m_val); }
|
||||
|
||||
rational const & get_rational() const { return *this; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue