| 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 // TODO: Convert this abstract class into a concrete class double | 7 // TODO: Convert this abstract class into a concrete class double |
| 8 // that uses the patch class functionality to account for the | 8 // that uses the patch class functionality to account for the |
| 9 // different platform implementations. | 9 // different platform implementations. |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 /** Euclidean modulo operator. */ | 38 /** Euclidean modulo operator. */ |
| 39 double operator %(num other); | 39 double operator %(num other); |
| 40 | 40 |
| 41 /** Division operator. */ | 41 /** Division operator. */ |
| 42 double operator /(num other); | 42 double operator /(num other); |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Truncating division operator. | 45 * Truncating division operator. |
| 46 * | 46 * |
| 47 * The result of the truncating division [:a ~/ b:] is equivalent to | 47 * The result of the truncating division [:a ~/ b:] is equivalent to |
| 48 * [:(a / b).truncate():]. | 48 * [:(a / b).truncate().toInt():]. |
| 49 */ | 49 */ |
| 50 double operator ~/(num other); | 50 int operator ~/(num other); |
| 51 | 51 |
| 52 /** Negate operator. */ | 52 /** Negate operator. */ |
| 53 double operator -(); | 53 double operator -(); |
| 54 | 54 |
| 55 /** Returns the absolute value of this [double]. */ | 55 /** Returns the absolute value of this [double]. */ |
| 56 double abs(); | 56 double abs(); |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * Returns the integer value closest to this [double]. | 59 * Returns the integer value closest to this [double]. |
| 60 * | 60 * |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 /** | 93 /** |
| 94 * Parse [source] as an double literal and return its value. | 94 * Parse [source] as an double literal and return its value. |
| 95 * | 95 * |
| 96 * Accepts the same format as double literals: | 96 * Accepts the same format as double literals: |
| 97 * [: ['+'|'-'] [digit* '.'] digit+ [('e'|'E') ['+'|'-'] digit+] :] | 97 * [: ['+'|'-'] [digit* '.'] digit+ [('e'|'E') ['+'|'-'] digit+] :] |
| 98 * | 98 * |
| 99 * Also recognizes "NaN", "Infinity" and "-Infinity" as inputs and | 99 * Also recognizes "NaN", "Infinity" and "-Infinity" as inputs and |
| 100 * returns the corresponding double value. | 100 * returns the corresponding double value. |
| 101 * | 101 * |
| 102 * Throws a [FormatException] if [source] is not a valid double literal. | 102 * If the [soure] is not a valid double literal, the [handleError] |
| 103 * is called with the [source] as argument, and its return value is |
| 104 * used instead. If no handleError is provided, a [FormatException] |
| 105 * is thrown. |
| 103 */ | 106 */ |
| 104 external static double parse(String source); | 107 external static double parse(String source, |
| 108 [double handleError(String source)]); |
| 105 } | 109 } |
| OLD | NEW |