OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart core library. | 5 // Dart core library. |
6 | 6 |
7 /** | 7 /** |
8 * *Note:* This class is **deprecated**, and will be removed soon. | 8 * *Note:* This class is **deprecated**, and will be removed soon. |
9 * Please use the [dart:math] library instead. | 9 * Please use the [dart:math] library instead. |
10 */ | 10 */ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 * Square root of 1/2. | 43 * Square root of 1/2. |
44 */ | 44 */ |
45 static final double SQRT1_2 = 0.7071067811865476; | 45 static final double SQRT1_2 = 0.7071067811865476; |
46 | 46 |
47 /** | 47 /** |
48 * Square root of 2. | 48 * Square root of 2. |
49 */ | 49 */ |
50 static final double SQRT2 = 1.4142135623730951; | 50 static final double SQRT2 = 1.4142135623730951; |
51 | 51 |
52 /** | 52 /** |
53 * Parses a [String] representation of an [int], and returns | 53 * Parses a [String] representation of an [int], and returns an [int]. Throws |
54 * an [int]. Throws a [BadNumberFormatException] if [str] | 54 * a [FormatException] if [str] cannot be parsed as an [int]. |
55 * cannot be parsed as an [int]. | |
56 */ | 55 */ |
57 static int parseInt(String str) => MathNatives.parseInt(str); | 56 static int parseInt(String str) => MathNatives.parseInt(str); |
58 | 57 |
59 /** | 58 /** |
60 * Parses a [String] representation of a [double], and returns | 59 * Parses a [String] representation of a [double], and returns a [double]. |
61 * a [double]. Throws a [BadNumberFormatException] if [str] cannot | 60 * Throws a [FormatException] if [str] cannot be parsed as a [double]. |
62 * be parsed as a [double]. | |
63 */ | 61 */ |
64 static double parseDouble(String str) => MathNatives.parseDouble(str); | 62 static double parseDouble(String str) => MathNatives.parseDouble(str); |
65 | 63 |
66 /** | 64 /** |
67 * Returns the minimum of two numbers. If either argument is NaN returns NaN. | 65 * Returns the minimum of two numbers. If either argument is NaN returns NaN. |
68 * The minimum of [:-0.0:] and [:0.0:] is [:-0.0:]. If both arguments are | 66 * The minimum of [:-0.0:] and [:0.0:] is [:-0.0:]. If both arguments are |
69 * equal (int and doubles with the same mathematical value are equal) then | 67 * equal (int and doubles with the same mathematical value are equal) then |
70 * it is unspecified which of the two arguments is returned. | 68 * it is unspecified which of the two arguments is returned. |
71 */ | 69 */ |
72 static num min(num a, num b) { | 70 static num min(num a, num b) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 static double sin(num x) => MathNatives.sin(x); | 153 static double sin(num x) => MathNatives.sin(x); |
156 static double cos(num x) => MathNatives.cos(x); | 154 static double cos(num x) => MathNatives.cos(x); |
157 static double tan(num x) => MathNatives.tan(x); | 155 static double tan(num x) => MathNatives.tan(x); |
158 static double acos(num x) => MathNatives.acos(x); | 156 static double acos(num x) => MathNatives.acos(x); |
159 static double asin(num x) => MathNatives.asin(x); | 157 static double asin(num x) => MathNatives.asin(x); |
160 static double atan(num x) => MathNatives.atan(x); | 158 static double atan(num x) => MathNatives.atan(x); |
161 static double sqrt(num x) => MathNatives.sqrt(x); | 159 static double sqrt(num x) => MathNatives.sqrt(x); |
162 static double exp(num x) => MathNatives.exp(x); | 160 static double exp(num x) => MathNatives.exp(x); |
163 static double log(num x) => MathNatives.log(x); | 161 static double log(num x) => MathNatives.log(x); |
164 } | 162 } |
OLD | NEW |