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 part of the dart:math library. | 5 // A part of the dart:math library. |
6 | 6 |
7 /** | 7 /** |
8 * Base of the natural logarithms. | 8 * Base of the natural logarithms. |
9 */ | 9 */ |
10 final double E = 2.718281828459045; | 10 final double E = 2.718281828459045; |
(...skipping 27 matching lines...) Expand all Loading... |
38 * Square root of 1/2. | 38 * Square root of 1/2. |
39 */ | 39 */ |
40 final double SQRT1_2 = 0.7071067811865476; | 40 final double SQRT1_2 = 0.7071067811865476; |
41 | 41 |
42 /** | 42 /** |
43 * Square root of 2. | 43 * Square root of 2. |
44 */ | 44 */ |
45 final double SQRT2 = 1.4142135623730951; | 45 final double SQRT2 = 1.4142135623730951; |
46 | 46 |
47 /** | 47 /** |
48 * Parses a [String] representation of an [int], and returns | 48 * Parses a [String] representation of an [int], and returns an [int]. Throws a |
49 * an [int]. Throws a [BadNumberFormatException] if [str] | 49 * [FormatException] if [str] cannot be parsed as an [int]. |
50 * cannot be parsed as an [int]. | |
51 */ | 50 */ |
52 int parseInt(String str) => MathNatives.parseInt(str); | 51 int parseInt(String str) => MathNatives.parseInt(str); |
53 | 52 |
54 /** | 53 /** |
55 * Parses a [String] representation of a [double], and returns | 54 * Parses a [String] representation of a [double], and returns a [double]. |
56 * a [double]. Throws a [BadNumberFormatException] if [str] cannot | 55 * Throws a [FormatException] if [str] cannot be parsed as a [double]. |
57 * be parsed as a [double]. | |
58 */ | 56 */ |
59 double parseDouble(String str) => MathNatives.parseDouble(str); | 57 double parseDouble(String str) => MathNatives.parseDouble(str); |
60 | 58 |
61 /** | 59 /** |
62 * Returns the minimum of two numbers. If either argument is NaN returns NaN. | 60 * Returns the minimum of two numbers. If either argument is NaN returns NaN. |
63 * The minimum of [:-0.0:] and [:0.0:] is [:-0.0:]. If both arguments are | 61 * The minimum of [:-0.0:] and [:0.0:] is [:-0.0:]. If both arguments are |
64 * equal (int and doubles with the same mathematical value are equal) then | 62 * equal (int and doubles with the same mathematical value are equal) then |
65 * it is unspecified which of the two arguments is returned. | 63 * it is unspecified which of the two arguments is returned. |
66 */ | 64 */ |
67 num min(num a, num b) { | 65 num min(num a, num b) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 141 |
144 double sin(num x) => MathNatives.sin(x); | 142 double sin(num x) => MathNatives.sin(x); |
145 double cos(num x) => MathNatives.cos(x); | 143 double cos(num x) => MathNatives.cos(x); |
146 double tan(num x) => MathNatives.tan(x); | 144 double tan(num x) => MathNatives.tan(x); |
147 double acos(num x) => MathNatives.acos(x); | 145 double acos(num x) => MathNatives.acos(x); |
148 double asin(num x) => MathNatives.asin(x); | 146 double asin(num x) => MathNatives.asin(x); |
149 double atan(num x) => MathNatives.atan(x); | 147 double atan(num x) => MathNatives.atan(x); |
150 double sqrt(num x) => MathNatives.sqrt(x); | 148 double sqrt(num x) => MathNatives.sqrt(x); |
151 double exp(num x) => MathNatives.exp(x); | 149 double exp(num x) => MathNatives.exp(x); |
152 double log(num x) => MathNatives.log(x); | 150 double log(num x) => MathNatives.log(x); |
OLD | NEW |