Commit d8041316 authored by floitschV8@gmail.com's avatar floitschV8@gmail.com

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5782 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent aab900fd
......@@ -259,10 +259,11 @@ TEST(Strtod) {
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 @@ TEST(Strtod) {
// 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 @@ TEST(Strtod) {
// 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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment