mirror of
https://github.com/Z3Prover/z3
synced 2025-08-04 10:20:23 +00:00
more scaffolding
This commit is contained in:
parent
a1f484fa35
commit
2fef6dc502
16 changed files with 476 additions and 152 deletions
|
@ -308,6 +308,10 @@ public:
|
|||
bool is_even() const {
|
||||
return m().is_even(m_val);
|
||||
}
|
||||
|
||||
bool is_odd() const {
|
||||
return !is_even();
|
||||
}
|
||||
|
||||
friend inline rational floor(rational const & r) {
|
||||
rational f;
|
||||
|
@ -333,6 +337,8 @@ public:
|
|||
return m().is_power_of_two(m_val, shift);
|
||||
}
|
||||
|
||||
bool mult_inverse(unsigned num_bits, rational & result);
|
||||
|
||||
static rational const & zero() {
|
||||
return m_zero;
|
||||
}
|
||||
|
@ -459,6 +465,18 @@ public:
|
|||
return get_num_digits(rational(10));
|
||||
}
|
||||
|
||||
bool get_bit(unsigned index) const {
|
||||
return m().get_bit(m_val, index);
|
||||
}
|
||||
|
||||
unsigned trailing_zeros() const {
|
||||
if (is_zero())
|
||||
return 0;
|
||||
unsigned k = 0;
|
||||
for (; !get_bit(k); ++k);
|
||||
return k;
|
||||
}
|
||||
|
||||
static bool limit_denominator(rational &num, rational const& limit);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue