Work around Windows bug. Use different constants.
authorfloitschV8@gmail.com <floitschV8@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Oct 2010 15:54:51 +0000 (15:54 +0000)
committerfloitschV8@gmail.com <floitschV8@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Oct 2010 15:54:51 +0000 (15:54 +0000)
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=
Review URL: http://codereview.chromium.org/3744008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-strtod.cc

index 1eefb7f..6102db6 100644 (file)
@@ -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));