Refactor normalize and clean up

This commit is contained in:
Victor Zverovich
2019-09-07 17:07:53 -07:00
parent 6649b8e0ca
commit ac71d853be
3 changed files with 31 additions and 30 deletions

View File

@@ -48,10 +48,10 @@ TEST(FPTest, ConstructFromDouble) {
}
TEST(FPTest, Normalize) {
auto v = fp(0xbeef, 42);
v.normalize();
EXPECT_EQ(0xbeef000000000000, v.f);
EXPECT_EQ(-6, v.e);
const auto v = fp(0xbeef, 42);
auto normalized = normalize(v);
EXPECT_EQ(0xbeef000000000000, normalized.f);
EXPECT_EQ(-6, normalized.e);
}
TEST(FPTest, ComputeBoundariesSubnormal) {