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 * Typically written as "e". | 10 * Typically written as "e". |
(...skipping 28 matching lines...) Expand all Loading... |
39 /** | 39 /** |
40 * Square root of 1/2. | 40 * Square root of 1/2. |
41 */ | 41 */ |
42 const double SQRT1_2 = 0.7071067811865476; | 42 const double SQRT1_2 = 0.7071067811865476; |
43 | 43 |
44 /** | 44 /** |
45 * Square root of 2. | 45 * Square root of 2. |
46 */ | 46 */ |
47 const double SQRT2 = 1.4142135623730951; | 47 const double SQRT2 = 1.4142135623730951; |
48 | 48 |
49 /** | 49 /** Temporary redirect to [int.parse]. */ |
50 * Parses a [String] representation of an [int], and returns an [int]. | 50 int parseInt(String string) => int.parse(string); |
51 * | |
52 * Throws a [FormatException] if [str] cannot be parsed as an [int]. | |
53 */ | |
54 external int parseInt(String str); | |
55 | 51 |
56 /** | 52 /** Temporary redirect to [double.parse]. */ |
57 * Parses a [String] representation of a [double], and returns a [double]. | 53 double parseDouble(String string) => double.parse(string); |
58 * | |
59 * Throws a [FormatException] if [str] cannot be parsed as a [double]. | |
60 */ | |
61 external double parseDouble(String str); | |
62 | 54 |
63 /** | 55 /** |
64 * Returns the lesser of two numbers. | 56 * Returns the lesser of two numbers. |
65 * | 57 * |
66 * Returns NaN if either argument is NaN. | 58 * Returns NaN if either argument is NaN. |
67 * The lesser of [:-0.0:] and [:0.0:] is [:-0.0:]. | 59 * The lesser of [:-0.0:] and [:0.0:] is [:-0.0:]. |
68 * If the arguments are otherwise equal (including int and doubles with the | 60 * If the arguments are otherwise equal (including int and doubles with the |
69 * same mathematical value) then it is unspecified which of the two arguments | 61 * same mathematical value) then it is unspecified which of the two arguments |
70 * is returned. | 62 * is returned. |
71 */ | 63 */ |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 * Returns NaN if [x] is NaN. | 218 * Returns NaN if [x] is NaN. |
227 */ | 219 */ |
228 external double exp(num x); | 220 external double exp(num x); |
229 | 221 |
230 /** | 222 /** |
231 * Converts [x] to a double and returns the natural logarithm of the value. | 223 * Converts [x] to a double and returns the natural logarithm of the value. |
232 * Returns negative infinity if [x] is equal to zero. | 224 * Returns negative infinity if [x] is equal to zero. |
233 * Returns NaN if [x] is NaN or less than zero. | 225 * Returns NaN if [x] is NaN or less than zero. |
234 */ | 226 */ |
235 external double log(num x); | 227 external double log(num x); |
OLD | NEW |