OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |