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

Side by Side Diff: test/cctest/test-strtod.cc

Issue 3851003: Fix double-rounding in strtod. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/strtod.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "cctest.h" 7 #include "cctest.h"
8 #include "strtod.h" 8 #include "strtod.h"
9 9
10 using namespace v8::internal; 10 using namespace v8::internal;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 CHECK_EQ(1234e305, StrtodChar("123400000", 300)); 191 CHECK_EQ(1234e305, StrtodChar("123400000", 300));
192 CHECK_EQ(1234e304, StrtodChar("123400000", 299)); 192 CHECK_EQ(1234e304, StrtodChar("123400000", 299));
193 CHECK_EQ(V8_INFINITY, StrtodChar("180000000", 300)); 193 CHECK_EQ(V8_INFINITY, StrtodChar("180000000", 300));
194 CHECK_EQ(17e307, StrtodChar("170000000", 300)); 194 CHECK_EQ(17e307, StrtodChar("170000000", 300));
195 CHECK_EQ(V8_INFINITY, StrtodChar("00000001000000", 303)); 195 CHECK_EQ(V8_INFINITY, StrtodChar("00000001000000", 303));
196 CHECK_EQ(1e308, StrtodChar("000000000000100000", 303)); 196 CHECK_EQ(1e308, StrtodChar("000000000000100000", 303));
197 CHECK_EQ(1234e305, StrtodChar("00000000123400000", 300)); 197 CHECK_EQ(1234e305, StrtodChar("00000000123400000", 300));
198 CHECK_EQ(1234e304, StrtodChar("0000000123400000", 299)); 198 CHECK_EQ(1234e304, StrtodChar("0000000123400000", 299));
199 CHECK_EQ(V8_INFINITY, StrtodChar("00000000180000000", 300)); 199 CHECK_EQ(V8_INFINITY, StrtodChar("00000000180000000", 300));
200 CHECK_EQ(17e307, StrtodChar("00000000170000000", 300)); 200 CHECK_EQ(17e307, StrtodChar("00000000170000000", 300));
201
202 // The following number is the result of 89255.0/1e-22. Both floating-point
203 // numbers can be accurately represented with doubles. However on Linux,x86
204 // the floating-point stack is set to 80bits and the double-rounding
205 // introduces an error.
206 CHECK_EQ(89255e-22, StrtodChar("89255", -22));
201 } 207 }
OLDNEW
« 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