diff --git a/include/lol/private/types/real.ipp b/include/lol/private/types/real.ipp index 9cf359e3..867068fd 100644 --- a/include/lol/private/types/real.ipp +++ b/include/lol/private/types/real.ipp @@ -557,10 +557,10 @@ template real_t real_t::operator *(real_t const &x) const prev = carry; carry += (uint64_t)m_mantissa[bigit_count() - 1 - j] * (uint64_t)x.m_mantissa[j]; - hicarry += (carry> bigit_bits() != carry >> bigit_bits()) + if ((carry + bigit_count()) >> bigit_bits() != carry >> bigit_bits()) { carry = 0; hicarry = 0; for (int i = 0; i < bigit_count(); ++i) @@ -582,7 +582,6 @@ template real_t real_t::operator *(real_t const &x) const carry |= hicarry << bigit_bits(); hicarry >>= bigit_bits(); - /* Multiply the other components */ for (int i = 0; i < bigit_count(); ++i) { @@ -591,12 +590,12 @@ template real_t real_t::operator *(real_t const &x) const prev = carry; carry += (uint64_t)m_mantissa[bigit_count() - 1 - j] * (uint64_t)x.m_mantissa[j - 1 - i]; - hicarry += (carry>= bigit_bits(); carry |= hicarry << bigit_bits();