Skip to content

Commit

Permalink
Remove fp::operator-
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Nov 24, 2019
1 parent 6003ec3 commit 111fc12
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,6 @@ class fp {

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) {
#if FMT_USE_INT128
auto product = static_cast<__uint128_t>(lhs) * rhs;
Expand Down
6 changes: 0 additions & 6 deletions test/format-impl-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
auto v = fp(123ULL << 32, 4) * fp(56ULL << 32, 7);
EXPECT_EQ(v.f, 123u * 56u);
Expand Down

0 comments on commit 111fc12

Please sign in to comment.