Reviewers: William Hesse,

Description:
Work around Windows bug. Use different constants.

Windows' strtod doesn't correctly read 3e-324 a the lowest denormal, but returns
0.0 instead.
Using 4e-324 is still the same value and works.

BUG=
TEST=

Please review this at http://codereview.chromium.org/3744008/show

Affected files:
  M test/cctest/test-strtod.cc


Index: test/cctest/test-strtod.cc
diff --git a/test/cctest/test-strtod.cc b/test/cctest/test-strtod.cc
index 1eefb7fd23786561fd4501baafe3a1fcccc581f4..6102db6ddc87c550c815784999549e12a8359714 100644
--- a/test/cctest/test-strtod.cc
+++ b/test/cctest/test-strtod.cc
@@ -154,20 +154,20 @@ TEST(Strtod) {
   CHECK_EQ(0.0, StrtodChar("", 1324));
   CHECK_EQ(0.0, StrtodChar("000000000", 123));
   CHECK_EQ(0.0, StrtodChar("2", -324));
-  CHECK_EQ(3e-324, StrtodChar("3", -324));
+  CHECK_EQ(4e-324, StrtodChar("3", -324));
// It would be more readable to put non-zero literals on the left side (i.e. // CHECK_EQ(1e-325, StrtodChar("1", -325))), but then Gcc complains that
   // they are truncated to zero.
   CHECK_EQ(0.0, StrtodChar("1", -325));
   CHECK_EQ(0.0, StrtodChar("1", -325));
   CHECK_EQ(0.0, StrtodChar("20000", -328));
-  CHECK_EQ(30000e-328, StrtodChar("30000", -328));
+  CHECK_EQ(40000e-328, StrtodChar("30000", -328));
   CHECK_EQ(0.0, StrtodChar("10000", -329));
   CHECK_EQ(0.0, StrtodChar("90000", -329));
   CHECK_EQ(0.0, StrtodChar("000000001", -325));
   CHECK_EQ(0.0, StrtodChar("000000001", -325));
   CHECK_EQ(0.0, StrtodChar("0000000020000", -328));
-  CHECK_EQ(30000e-328, StrtodChar("00000030000", -328));
+  CHECK_EQ(40000e-328, StrtodChar("00000030000", -328));
   CHECK_EQ(0.0, StrtodChar("0000000010000", -329));
   CHECK_EQ(0.0, StrtodChar("0000000090000", -329));



--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to