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

Side by Side Diff: runtime/lib/math_patch.dart

Issue 10913271: Move parseInt parseDouble to int/double classes as a static method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make int.parse directly native. Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/lib/math.dart ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // A VM patch of the dart:math library. 5 // A VM patch of the dart:math library.
6 patch int parseInt(String str) => MathNatives.parseInt(str);
7 patch double parseDouble(String str) => MathNatives.parseDouble(str);
8 patch num pow(num x, num exponent) => MathNatives.pow(x, exponent); 6 patch num pow(num x, num exponent) => MathNatives.pow(x, exponent);
9 patch double atan2(num a, num b) => MathNatives.atan2(a, b); 7 patch double atan2(num a, num b) => MathNatives.atan2(a, b);
10 patch double sin(num x) => MathNatives.sin(x); 8 patch double sin(num x) => MathNatives.sin(x);
11 patch double cos(num x) => MathNatives.cos(x); 9 patch double cos(num x) => MathNatives.cos(x);
12 patch double tan(num x) => MathNatives.tan(x); 10 patch double tan(num x) => MathNatives.tan(x);
13 patch double acos(num x) => MathNatives.acos(x); 11 patch double acos(num x) => MathNatives.acos(x);
14 patch double asin(num x) => MathNatives.asin(x); 12 patch double asin(num x) => MathNatives.asin(x);
15 patch double atan(num x) => MathNatives.atan(x); 13 patch double atan(num x) => MathNatives.atan(x);
16 patch double sqrt(num x) => MathNatives.sqrt(x); 14 patch double sqrt(num x) => MathNatives.sqrt(x);
17 patch double exp(num x) => MathNatives.exp(x); 15 patch double exp(num x) => MathNatives.exp(x);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 static int _nextSeed() { 86 static int _nextSeed() {
89 if (_prng == null) { 87 if (_prng == null) {
90 // TODO(iposva): Use system to get a random seed. 88 // TODO(iposva): Use system to get a random seed.
91 _prng = new Random(new Date.now().millisecondsSinceEpoch); 89 _prng = new Random(new Date.now().millisecondsSinceEpoch);
92 } 90 }
93 // Trigger the PRNG once to change the internal state. 91 // Trigger the PRNG once to change the internal state.
94 _prng._nextInt32(); 92 _prng._nextInt32();
95 return _prng._state; 93 return _prng._state;
96 } 94 }
97 } 95 }
OLDNEW
« no previous file with comments | « runtime/lib/math.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698