Remove unused BigInteger::operator+=(const BigInteger&)

This commit is contained in:
Milo Yip 2014-09-15 00:31:38 +08:00
parent cbd7475242
commit bea4fa7f6a
2 changed files with 0 additions and 40 deletions

View File

@ -122,22 +122,6 @@ public:
return *this;
}
BigInteger& operator+=(const BigInteger& rhs) {
size_t count = count_ > rhs.count_ ? count_ : rhs.count_;
bool carry = false;
for (size_t i = 0; i < count; i++) {
bool outCarry;
digits_[i] = FullAdd(i < count_ ? digits_[i] : 0, i < rhs.count_ ? rhs.digits_[i] : 0, carry, &outCarry);
carry = outCarry;
}
count_ = count;
if (carry)
PushBack(1);
return *this;
}
BigInteger& operator*=(uint64_t u) {
if (u == 0) return *this = 0;
if (u == 1) return *this;

View File

@ -66,30 +66,6 @@ TEST(Strtod, BigInteger_AddUint64) {
EXPECT_TRUE(BIGINTEGER_LITERAL("36893488147419103231") == b);
}
TEST(Strtod, BigInteger_Add) {
BigInteger a = kZero;
a += kZero;
EXPECT_TRUE(kZero == a);
a += kOne;
EXPECT_TRUE(kOne == a);
a += kOne;
EXPECT_TRUE(BigInteger(2) == a);
a = kUint64Max;
a += kOne;
EXPECT_TRUE(kTwo64 == a);
a = kOne;
a += kTwo64;
EXPECT_TRUE(BIGINTEGER_LITERAL("18446744073709551617") == a);
a = kTwo64;
a += kOne;
EXPECT_TRUE(BIGINTEGER_LITERAL("18446744073709551617") == a);
}
TEST(Strtod, BigInteger_MultiplyUint64) {
BigInteger a = kZero;
a *= static_cast <uint64_t>(0);