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