diff --git a/src/math/real.cpp b/src/math/real.cpp index 596ecca8..7a50ddbd 100644 --- a/src/math/real.cpp +++ b/src/math/real.cpp @@ -726,12 +726,12 @@ template<> real sqrt(real const &x) ret.m_mantissa.resize(x.m_mantissa.count()); ret.m_mantissa[0] = v.x << 9; - /* FIXME: check this, it’s been a long time… */ + /* FIXME FIXME FIXME: this is broken */ ret.m_exponent = -x.m_exponent / 2 + (v.x >> 23) - (u.x >> 23); /* FIXME: 1+log2(bigit_count()) steps of Newton-Raphson seems to be enough for * convergence, but this hasn't been checked seriously. */ - for (int i = 1; i <= x.bigit_count(); i *= 2) + for (int i = 1; i <= 1024 * x.bigit_count(); i *= 2) { ret = ret * (real::R_3() - ret * ret * x); --ret.m_exponent;