diff --git a/include/rapidjson/internal/strtod.h b/include/rapidjson/internal/strtod.h index 01463fe..46248bc 100644 --- a/include/rapidjson/internal/strtod.h +++ b/include/rapidjson/internal/strtod.h @@ -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; diff --git a/test/unittest/strtodtest.cpp b/test/unittest/strtodtest.cpp index d0319c2..ae56412 100644 --- a/test/unittest/strtodtest.cpp +++ b/test/unittest/strtodtest.cpp @@ -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 (0);