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 external int parseInt(String str); | 51 external int parseInt(String 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 external double parseDouble(String str); | 57 external double parseDouble(String str); |
60 | 58 |
61 num min(num a, num b) { | 59 num min(num a, num b) { |
62 int c = a.compareTo(b); | 60 int c = a.compareTo(b); |
63 if (c == 0) return a; | 61 if (c == 0) return a; |
64 if (c < 0) { | 62 if (c < 0) { |
65 if ((b is double) && b.isNaN()) return b; | 63 if ((b is double) && b.isNaN()) return b; |
66 return a; | 64 return a; |
67 } | 65 } |
(...skipping 20 matching lines...) Expand all Loading... |
88 | 86 |
89 external double sin(num x); | 87 external double sin(num x); |
90 external double cos(num x); | 88 external double cos(num x); |
91 external double tan(num x); | 89 external double tan(num x); |
92 external double acos(num x); | 90 external double acos(num x); |
93 external double asin(num x); | 91 external double asin(num x); |
94 external double atan(num x); | 92 external double atan(num x); |
95 external double sqrt(num x); | 93 external double sqrt(num x); |
96 external double exp(num x); | 94 external double exp(num x); |
97 external double log(num x); | 95 external double log(num x); |
OLD | NEW |