From: David Gow Date: Sun, 6 Jul 2014 14:31:09 +0000 (+0800) Subject: Maybe this is more correct. realops likes it. X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a2791dc25392472c9dc2c8a2f738f6695fc8d292;p=ipdf%2Fcode.git Maybe this is more correct. realops likes it. --- diff --git a/src/arbint.cpp b/src/arbint.cpp index 696dcd0..582d99a 100644 --- a/src/arbint.cpp +++ b/src/arbint.cpp @@ -203,7 +203,10 @@ Arbint & Arbint::SubBasic(const Arbint & sub) { m_sign = !m_sign; for (unsigned i = 0; i < m_digits.size(); ++i) - m_digits[i] = (~m_digits[i]) + 1; + m_digits[i] = (~m_digits[i]); + std::vector one_digits(m_digits.size(), 0L); + one_digits[0] = 1; + add_digits((digit_t*)m_digits.data(), (digit_t*)one_digits.data(), m_digits.size()); } return *this; }