OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 15 matching lines...) Expand all Loading... |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <limits.h> | 28 #include <limits.h> |
29 #include <math.h> | 29 #include <math.h> |
30 | 30 |
31 #include "double-conversion.h" | 31 #include "double-conversion.h" |
32 | 32 |
33 #include "bignum-dtoa.h" | 33 #include "bignum-dtoa.h" |
34 | 34 |
35 // Remove the double-based fast cases and use big int operations always for | 35 // Remove the double-based fast cases and use big int operations always for |
36 // Fletch. This cuts more than 8KB off the binary size. | 36 // Dartino. This cuts more than 8KB off the binary size. |
37 // | 37 // |
38 // #include "fast-dtoa.h" | 38 // #include "fast-dtoa.h" |
39 // #include "fixed-dtoa.h" | 39 // #include "fixed-dtoa.h" |
40 | 40 |
41 #include "ieee.h" | 41 #include "ieee.h" |
42 #include "strtod.h" | 42 #include "strtod.h" |
43 #include "utils.h" | 43 #include "utils.h" |
44 | 44 |
45 namespace double_conversion { | 45 namespace double_conversion { |
46 | 46 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 384 |
385 if (v == 0) { | 385 if (v == 0) { |
386 vector[0] = '0'; | 386 vector[0] = '0'; |
387 vector[1] = '\0'; | 387 vector[1] = '\0'; |
388 *length = 1; | 388 *length = 1; |
389 *point = 1; | 389 *point = 1; |
390 return; | 390 return; |
391 } | 391 } |
392 | 392 |
393 // Remove the double-based fast cases and use big int operations always for | 393 // Remove the double-based fast cases and use big int operations always for |
394 // Fletch. This cuts more than 8KB off the binary size. | 394 // Dartino. This cuts more than 8KB off the binary size. |
395 /* | 395 /* |
396 bool fast_worked; | 396 bool fast_worked; |
397 switch (mode) { | 397 switch (mode) { |
398 case SHORTEST: | 398 case SHORTEST: |
399 fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST, 0, vector, length, point); | 399 fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST, 0, vector, length, point); |
400 break; | 400 break; |
401 case SHORTEST_SINGLE: | 401 case SHORTEST_SINGLE: |
402 fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST_SINGLE, 0, | 402 fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST_SINGLE, 0, |
403 vector, length, point); | 403 vector, length, point); |
404 break; | 404 break; |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 | 982 |
983 float StringToDoubleConverter::StringToFloat( | 983 float StringToDoubleConverter::StringToFloat( |
984 const uc16* buffer, | 984 const uc16* buffer, |
985 int length, | 985 int length, |
986 int* processed_characters_count) const { | 986 int* processed_characters_count) const { |
987 return static_cast<float>(StringToIeee(buffer, length, false, | 987 return static_cast<float>(StringToIeee(buffer, length, false, |
988 processed_characters_count)); | 988 processed_characters_count)); |
989 } | 989 } |
990 | 990 |
991 } // namespace double_conversion | 991 } // namespace double_conversion |
OLD | NEW |