3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 02:15:19 +00:00

Fix rounding bug in mpf_manager. Fixes #2970.

This commit is contained in:
Christoph M. Wintersteiger 2020-07-16 12:39:12 +00:00
parent ccdae7af24
commit d3ae40130a
No known key found for this signature in database
GPG key ID: BCF6360F86294467

View file

@ -351,10 +351,7 @@ void mpf_manager::set(mpf & o, unsigned ebits, unsigned sbits, mpf_rounding_mode
signed ds = sbits - x.sbits + 3; // plus rounding bits
if (ds > 0)
{
m_mpz_manager.mul2k(o.significand, ds);
round(rm, o);
}
else if (ds < 0)
{
bool sticky = false;
@ -366,8 +363,9 @@ void mpf_manager::set(mpf & o, unsigned ebits, unsigned sbits, mpf_rounding_mode
}
if (sticky && m_mpz_manager.is_even(o.significand))
m_mpz_manager.inc(o.significand);
round(rm, o);
}
round(rm, o);
}
}