mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Remove fp::operator-
This commit is contained in:
parent
6003ec3f25
commit
111fc127fe
@ -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;
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user