Remove fp::operator-

This commit is contained in:
Victor Zverovich 2019-11-24 13:28:15 -08:00
parent 6003ec3f25
commit 111fc127fe
2 changed files with 0 additions and 12 deletions

View File

@ -452,12 +452,6 @@ class fp {
inline bool operator==(fp x, fp y) { return x.f == y.f && x.e == y.e; } inline bool operator==(fp x, fp y) { return x.f == y.f && x.e == y.e; }
// Returns an fp number representing x - y. Result may not be normalized.
inline fp operator-(fp x, fp y) {
FMT_ASSERT(x.f >= y.f && x.e == y.e, "invalid operands");
return {x.f - y.f, x.e};
}
inline uint64_t multiply(uint64_t lhs, uint64_t rhs) { inline uint64_t multiply(uint64_t lhs, uint64_t rhs) {
#if FMT_USE_INT128 #if FMT_USE_INT128
auto product = static_cast<__uint128_t>(lhs) * rhs; auto product = static_cast<__uint128_t>(lhs) * rhs;

View File

@ -250,12 +250,6 @@ TEST(FPTest, ComputeFloatBoundaries) {
} }
} }
TEST(FPTest, Subtract) {
auto v = fp(123, 1) - fp(102, 1);
EXPECT_EQ(v.f, 21u);
EXPECT_EQ(v.e, 1);
}
TEST(FPTest, Multiply) { TEST(FPTest, Multiply) {
auto v = fp(123ULL << 32, 4) * fp(56ULL << 32, 7); auto v = fp(123ULL << 32, 4) * fp(56ULL << 32, 7);
EXPECT_EQ(v.f, 123u * 56u); EXPECT_EQ(v.f, 123u * 56u);