From f316def72de6817006377360d94dc08ff2e2ca36 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Sat, 27 Jan 2007 16:06:17 -0500 Subject: [PATCH] Old snapshot `BigIntegerLibrary-2005.03.30'; see the ChangeLog file. --- BigInteger.cc | 6 ++++-- CHANGELOG | 4 ++++ README | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/BigInteger.cc b/BigInteger.cc index 69d2dd7..5acf459 100644 --- a/BigInteger.cc +++ b/BigInteger.cc @@ -358,9 +358,11 @@ void BigInteger::subtract(const BigInteger &a, const BigInteger &b) { // If a is zero, copy b and flip its sign. If b is zero, copy a. if (a.sign == zero) { BigUnsigned::operator =(b); - sign = Sign(-sign); + // Take the negative of _b_'s, sign, not ours. + // Bug pointed out by Sam Larkin on 2005.03.30. + sign = Sign(-b.sign); } else if (b.sign == zero) - operator =(a); + operator =(a); // If their signs differ, take a.sign and add the magnitudes. else if (a.sign != b.sign) { sign = a.sign; diff --git a/CHANGELOG b/CHANGELOG index e79ba1e..5f706b0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,10 @@ Change Log ========== These entries tell you what was added, fixed, or improved in each version as compared to the previous one. In case you haven't noticed, a version number roughly corresponds to the release date of that version in `YYYY.MM.DD[.N]' format, where `.N' goes `.2', `.3', etc. if there are multiple versions on the same day. +2005.03.30 +---------- +Sam Larkin found a bug in `BigInteger::subtract'; I fixed it. + 2005.01.18 ---------- I fixed some problems with `easyDataToBI'. Due to some multiply declared variables, this function would not compile. However, it is a template function, so the compiler parses it and doesn't compile the parsed representation until something uses the function; this is how I missed the problems. I also removed debugging output from this function. diff --git a/README b/README index 2f71144..211158e 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ +===================================================================+ | Big Integer Library | | A C++ library that does arithmetic on integers of unlimited size. | -| Version 2005.01.18 | +| Version 2005.03.30 | +-------------------------------------------------------------------+ | By Matt McCutchen | | E-mail: hashproduct@verizon.net | -- 2.34.1