Compare exact binary representation for full precision test

Conflicts:
	doc/diagram/simpledom.png
This commit is contained in:
miloyip 2015-04-11 11:26:47 +08:00
parent 7e24024f51
commit 55f8339a0a

View File

@ -189,14 +189,15 @@ static void TestParseDouble() {
ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code()); \
EXPECT_EQ(1u, h.step_); \
internal::Double e(x), a(h.actual_); \
EXPECT_EQ(e.Sign(), a.Sign()); \
if (fullPrecision) { \
EXPECT_NEAR(x, h.actual_, 0.0); \
if (x != h.actual_) \
printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", str, h.actual_, x); \
EXPECT_EQ(e.Uint64Value(), a.Uint64Value()); \
if (e.Uint64Value() != a.Uint64Value()) \
printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", str, h.actual_, x); \
} \
else \
else { \
EXPECT_EQ(e.Sign(), a.Sign()); /* for 0.0 != -0.0 */ \
EXPECT_DOUBLE_EQ(x, h.actual_); \
} \
}
TEST_DOUBLE(fullPrecision, "0.0", 0.0);