mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
fix multiplier base for #5022
add also some C++ API shorthands for retrieving numerals
This commit is contained in:
parent
d0c96abe30
commit
c808f74591
2 changed files with 7 additions and 2 deletions
|
@ -1682,9 +1682,9 @@ double mpz_manager<SYNCH>::get_double(mpz const & a) const {
|
|||
for (unsigned i = 0; i < sz; i++) {
|
||||
r += d * static_cast<double>(digits(a)[i]);
|
||||
if (sizeof(digit_t) == sizeof(uint64_t))
|
||||
d *= static_cast<double>(UINT64_MAX); // 64-bit version
|
||||
d *= (1.0 + static_cast<double>(UINT64_MAX)); // 64-bit version, multiply by 2^64
|
||||
else
|
||||
d *= static_cast<double>(UINT_MAX); // 32-bit version
|
||||
d *= (1.0 + static_cast<double>(UINT_MAX)); // 32-bit version, multiply by 2^32
|
||||
}
|
||||
if (!(r >= 0.0)) {
|
||||
r = static_cast<double>(UINT64_MAX); // some large number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue