Revision: 5782
Author: [email protected]
Date: Mon Nov  8 05:04:47 2010
Log: Work around windows compiler bug.

Doubles that lie exactly between two doubles should round to the even one.

Review URL: http://codereview.chromium.org/4653003
http://code.google.com/p/v8/source/detail?r=5782

Modified:
 /branches/bleeding_edge/test/cctest/test-strtod.cc

=======================================
--- /branches/bleeding_edge/test/cctest/test-strtod.cc Mon Nov 8 03:49:47 2010 +++ /branches/bleeding_edge/test/cctest/test-strtod.cc Mon Nov 8 05:04:47 2010
@@ -259,10 +259,11 @@
   CHECK_EQ(1234567890123456789052345e115,
            StrtodChar("1234567890123456789052345", 115));

-  // Boundary cases.
+  // Boundary cases. Boundaries themselves should round to even.
+  //
   // 0x1FFFFFFFFFFFF * 2^3 = 72057594037927928
   //                   next: 72057594037927936
-  //               boundary: 72057594037927932
+  //               boundary: 72057594037927932  should round up.
   CHECK_EQ(72057594037927928.0, StrtodChar("72057594037927928", 0));
   CHECK_EQ(72057594037927936.0, StrtodChar("72057594037927936", 0));
   CHECK_EQ(72057594037927936.0, StrtodChar("72057594037927932", 0));
@@ -271,21 +272,21 @@

   // 0x1FFFFFFFFFFFF * 2^10 = 9223372036854774784
   //                    next: 9223372036854775808
-  //                boundary: 9223372036854775296
+  //                boundary: 9223372036854775296 should round up.
   CHECK_EQ(9223372036854774784.0, StrtodChar("9223372036854774784", 0));
   CHECK_EQ(9223372036854775808.0, StrtodChar("9223372036854775808", 0));
-  CHECK_EQ(9223372036854775296.0, StrtodChar("9223372036854775296", 0));
+  CHECK_EQ(9223372036854775808.0, StrtodChar("9223372036854775296", 0));
CHECK_EQ(9223372036854774784.0, StrtodChar("922337203685477529599999", -5)); CHECK_EQ(9223372036854775808.0, StrtodChar("922337203685477529600001", -5));

   // 0x1FFFFFFFFFFFF * 2^50 = 10141204801825834086073718800384
   //                    next: 10141204801825835211973625643008
-  //                boundary: 10141204801825834649023672221696
+ // boundary: 10141204801825834649023672221696 should round up.
   CHECK_EQ(10141204801825834086073718800384.0,
            StrtodChar("10141204801825834086073718800384", 0));
   CHECK_EQ(10141204801825835211973625643008.0,
            StrtodChar("10141204801825835211973625643008", 0));
-  CHECK_EQ(10141204801825834649023672221696.0,
+  CHECK_EQ(10141204801825835211973625643008.0,
            StrtodChar("10141204801825834649023672221696", 0));
   CHECK_EQ(10141204801825834086073718800384.0,
            StrtodChar("1014120480182583464902367222169599999", -5));
@@ -295,11 +296,12 @@
// 0x1FFFFFFFFFFFF * 2^99 = 5708990770823838890407843763683279797179383808 // next: 5708990770823839524233143877797980545530986496 // boundary: 5708990770823839207320493820740630171355185152
+  // The boundary should round up.
   CHECK_EQ(5708990770823838890407843763683279797179383808.0,
StrtodChar("5708990770823838890407843763683279797179383808", 0));
   CHECK_EQ(5708990770823839524233143877797980545530986496.0,
StrtodChar("5708990770823839524233143877797980545530986496", 0));
-  CHECK_EQ(5708990770823839207320493820740630171355185152.0,
+  CHECK_EQ(5708990770823839524233143877797980545530986496.0,
StrtodChar("5708990770823839207320493820740630171355185152", 0));
   CHECK_EQ(5708990770823838890407843763683279797179383808.0,
StrtodChar("5708990770823839207320493820740630171355185151999", -3));

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

Reply via email to