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

Unified Diff: runtime/lib/double_patch.dart

Issue 649113005: Make JSON parsing work as a chunked conversion sink. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also add an UTF-8 base JSON parser, without intermediate string representations. Created 6 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
Index: runtime/lib/double_patch.dart
diff --git a/runtime/lib/double_patch.dart b/runtime/lib/double_patch.dart
index f00a833957dc03faa22409aeaab84c27fc8fa022..f33122ac763da4de7ff8611918fa8aa8d5c5a204 100644
--- a/runtime/lib/double_patch.dart
+++ b/runtime/lib/double_patch.dart
@@ -80,33 +80,7 @@ patch class double {
}
if (!digitsSeen) return null; // No digits.
if (exponent == 0) return sign * doubleValue;
- // Powers of 10 up to 10^22 are representable as doubles.
- // Powers of 10 above that are only approximate due to lack of precission.
- const P10 = const [
- 1.0, /* 0 */
- 10.0,
- 100.0,
- 1000.0,
- 10000.0,
- 100000.0, /* 5 */
- 1000000.0,
- 10000000.0,
- 100000000.0,
- 1000000000.0,
- 10000000000.0, /* 10 */
- 100000000000.0,
- 1000000000000.0,
- 10000000000000.0,
- 100000000000000.0,
- 1000000000000000.0, /* 15 */
- 10000000000000000.0,
- 100000000000000000.0,
- 1000000000000000000.0,
- 10000000000000000000.0,
- 100000000000000000000.0, /* 20 */
- 1000000000000000000000.0,
- 10000000000000000000000.0,
- ];
+ const P10 = POWERS_OF_TEN; // From shared library
if (exponent < 0) {
int negExponent = -exponent;
if (negExponent >= P10.length) return null;

Powered by Google App Engine
This is Rietveld 408576698