mirror of
https://github.com/Z3Prover/z3
synced 2026-01-09 04:18:57 +00:00
import updates to rational from polysat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
575538d325
commit
e580c384b8
5 changed files with 60 additions and 1 deletions
|
|
@ -2288,6 +2288,19 @@ unsigned mpz_manager<SYNCH>::bitsize(mpz const & a) {
|
|||
return mlog2(a) + 1;
|
||||
}
|
||||
|
||||
template<bool SYNCH>
|
||||
unsigned mpz_manager<SYNCH>::next_power_of_two(mpz const & a) {
|
||||
if (is_nonpos(a))
|
||||
return 0;
|
||||
if (is_one(a))
|
||||
return 0;
|
||||
unsigned shift;
|
||||
if (is_power_of_two(a, shift))
|
||||
return shift;
|
||||
else
|
||||
return log2(a) + 1;
|
||||
}
|
||||
|
||||
template<bool SYNCH>
|
||||
bool mpz_manager<SYNCH>::is_perfect_square(mpz const & a, mpz & root) {
|
||||
if (is_neg(a))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue