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

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

Issue 3760013: Strtod fast-case that uses DiyFps and cached powers of ten. (Closed)
Patch Set: Addressed comments. 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 201
202 // The following number is the result of 89255.0/1e-22. Both floating-point 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 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 204 // the floating-point stack is set to 80bits and the double-rounding
205 // introduces an error. 205 // introduces an error.
206 CHECK_EQ(89255e-22, StrtodChar("89255", -22)); 206 CHECK_EQ(89255e-22, StrtodChar("89255", -22));
207 CHECK_EQ(104110013277974872254e-225,
208 StrtodChar("104110013277974872254", -225));
209
210 CHECK_EQ(123456789e108, StrtodChar("123456789", 108));
211 CHECK_EQ(123456789e109, StrtodChar("123456789", 109));
212 CHECK_EQ(123456789e110, StrtodChar("123456789", 110));
213 CHECK_EQ(123456789e111, StrtodChar("123456789", 111));
214 CHECK_EQ(123456789e112, StrtodChar("123456789", 112));
215 CHECK_EQ(123456789e113, StrtodChar("123456789", 113));
216 CHECK_EQ(123456789e114, StrtodChar("123456789", 114));
217 CHECK_EQ(123456789e115, StrtodChar("123456789", 115));
218
219 CHECK_EQ(1234567890123456789012345e108,
220 StrtodChar("1234567890123456789012345", 108));
221 CHECK_EQ(1234567890123456789012345e109,
222 StrtodChar("1234567890123456789012345", 109));
223 CHECK_EQ(1234567890123456789012345e110,
224 StrtodChar("1234567890123456789012345", 110));
225 CHECK_EQ(1234567890123456789012345e111,
226 StrtodChar("1234567890123456789012345", 111));
227 CHECK_EQ(1234567890123456789012345e112,
228 StrtodChar("1234567890123456789012345", 112));
229 CHECK_EQ(1234567890123456789012345e113,
230 StrtodChar("1234567890123456789012345", 113));
231 CHECK_EQ(1234567890123456789012345e114,
232 StrtodChar("1234567890123456789012345", 114));
233 CHECK_EQ(1234567890123456789012345e115,
234 StrtodChar("1234567890123456789012345", 115));
235
236 CHECK_EQ(1234567890123456789052345e108,
237 StrtodChar("1234567890123456789052345", 108));
238 CHECK_EQ(1234567890123456789052345e109,
239 StrtodChar("1234567890123456789052345", 109));
240 CHECK_EQ(1234567890123456789052345e110,
241 StrtodChar("1234567890123456789052345", 110));
242 CHECK_EQ(1234567890123456789052345e111,
243 StrtodChar("1234567890123456789052345", 111));
244 CHECK_EQ(1234567890123456789052345e112,
245 StrtodChar("1234567890123456789052345", 112));
246 CHECK_EQ(1234567890123456789052345e113,
247 StrtodChar("1234567890123456789052345", 113));
248 CHECK_EQ(1234567890123456789052345e114,
249 StrtodChar("1234567890123456789052345", 114));
250 CHECK_EQ(1234567890123456789052345e115,
251 StrtodChar("1234567890123456789052345", 115));
207 } 252 }
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