From 04266fccc9528256b9c1b9b7435155de9b51463a Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 21 Sep 2015 20:56:07 +0100 Subject: [PATCH] Bugfix for mpf sqrt. Fixes #222. --- src/util/mpf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/mpf.cpp b/src/util/mpf.cpp index d2b294305..855668e5a 100644 --- a/src/util/mpf.cpp +++ b/src/util/mpf.cpp @@ -990,6 +990,7 @@ void mpf_manager::sqrt(mpf_rounding_mode rm, mpf const & x, mpf & o) { TRACE("mpf_dbg", tout << "dec'ed " << m_mpz_manager.to_string(o.significand) << std::endl;); } o.exponent = a.exponent() >> 1; + if (a.exponent() % 2 == 0) o.exponent--; round(rm, o); }