Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: test/cctest/test-strtod.cc

Issue 3898007: Strtod fast-case that uses DiyFps and cached powers of ten. (Closed)
Patch Set: Strtod fast-case that uses DiyFps and cached powers of ten.... Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/strtod.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strtod.cc
===================================================================
--- test/cctest/test-strtod.cc (revision 5685)
+++ test/cctest/test-strtod.cc (working copy)
@@ -198,10 +198,58 @@
CHECK_EQ(1234e304, StrtodChar("0000000123400000", 299));
CHECK_EQ(V8_INFINITY, StrtodChar("00000000180000000", 300));
CHECK_EQ(17e307, StrtodChar("00000000170000000", 300));
+ CHECK_EQ(1.7976931348623157E+308, StrtodChar("17976931348623157", 292));
+ CHECK_EQ(1.7976931348623158E+308, StrtodChar("17976931348623158", 292));
+ CHECK_EQ(V8_INFINITY, StrtodChar("17976931348623159", 292));
// The following number is the result of 89255.0/1e-22. Both floating-point
// numbers can be accurately represented with doubles. However on Linux,x86
// the floating-point stack is set to 80bits and the double-rounding
// introduces an error.
CHECK_EQ(89255e-22, StrtodChar("89255", -22));
+ CHECK_EQ(104110013277974872254e-225,
+ StrtodChar("104110013277974872254", -225));
+
+ CHECK_EQ(123456789e108, StrtodChar("123456789", 108));
+ CHECK_EQ(123456789e109, StrtodChar("123456789", 109));
+ CHECK_EQ(123456789e110, StrtodChar("123456789", 110));
+ CHECK_EQ(123456789e111, StrtodChar("123456789", 111));
+ CHECK_EQ(123456789e112, StrtodChar("123456789", 112));
+ CHECK_EQ(123456789e113, StrtodChar("123456789", 113));
+ CHECK_EQ(123456789e114, StrtodChar("123456789", 114));
+ CHECK_EQ(123456789e115, StrtodChar("123456789", 115));
+
+ CHECK_EQ(1234567890123456789012345e108,
+ StrtodChar("1234567890123456789012345", 108));
+ CHECK_EQ(1234567890123456789012345e109,
+ StrtodChar("1234567890123456789012345", 109));
+ CHECK_EQ(1234567890123456789012345e110,
+ StrtodChar("1234567890123456789012345", 110));
+ CHECK_EQ(1234567890123456789012345e111,
+ StrtodChar("1234567890123456789012345", 111));
+ CHECK_EQ(1234567890123456789012345e112,
+ StrtodChar("1234567890123456789012345", 112));
+ CHECK_EQ(1234567890123456789012345e113,
+ StrtodChar("1234567890123456789012345", 113));
+ CHECK_EQ(1234567890123456789012345e114,
+ StrtodChar("1234567890123456789012345", 114));
+ CHECK_EQ(1234567890123456789012345e115,
+ StrtodChar("1234567890123456789012345", 115));
+
+ CHECK_EQ(1234567890123456789052345e108,
+ StrtodChar("1234567890123456789052345", 108));
+ CHECK_EQ(1234567890123456789052345e109,
+ StrtodChar("1234567890123456789052345", 109));
+ CHECK_EQ(1234567890123456789052345e110,
+ StrtodChar("1234567890123456789052345", 110));
+ CHECK_EQ(1234567890123456789052345e111,
+ StrtodChar("1234567890123456789052345", 111));
+ CHECK_EQ(1234567890123456789052345e112,
+ StrtodChar("1234567890123456789052345", 112));
+ CHECK_EQ(1234567890123456789052345e113,
+ StrtodChar("1234567890123456789052345", 113));
+ CHECK_EQ(1234567890123456789052345e114,
+ StrtodChar("1234567890123456789052345", 114));
+ CHECK_EQ(1234567890123456789052345e115,
+ StrtodChar("1234567890123456789052345", 115));
}
« no previous file with comments | « src/strtod.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698