| 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 /** | 7 /** |
| 8 * Representation of Dart integers containing integer specific | 8 * Representation of Dart integers containing integer specific |
| 9 * operations and specialization of operations inherited from [num]. | 9 * operations and specialization of operations inherited from [num]. |
| 10 * | 10 * |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 /** Returns true if and only if this integer is odd. */ | 43 /** Returns true if and only if this integer is odd. */ |
| 44 bool get isOdd; | 44 bool get isOdd; |
| 45 | 45 |
| 46 /** Negate operator. Negating an integer produces an integer. */ | 46 /** Negate operator. Negating an integer produces an integer. */ |
| 47 int operator -(); | 47 int operator -(); |
| 48 | 48 |
| 49 /** Returns the absolute value of this integer. */ | 49 /** Returns the absolute value of this integer. */ |
| 50 int abs(); | 50 int abs(); |
| 51 | 51 |
| 52 /** Returns [this]. */ | 52 /** Returns `this`. */ |
| 53 int round(); | 53 int round(); |
| 54 | 54 |
| 55 /** Returns [this]. */ | 55 /** Returns `this`. */ |
| 56 int floor(); | 56 int floor(); |
| 57 | 57 |
| 58 /** Returns [this]. */ | 58 /** Returns [this]. */ |
| 59 int ceil(); | 59 int ceil(); |
| 60 | 60 |
| 61 /** Returns [this]. */ | 61 /** Returns [this]. */ |
| 62 int truncate(); | 62 int truncate(); |
| 63 | 63 |
| 64 /** Returns `this.toDouble()`. */ |
| 65 double roundToDouble(); |
| 66 |
| 67 /** Returns `this.toDouble()`. */ |
| 68 double floorToDouble(); |
| 69 |
| 70 /** Returns `this.toDouble()`. */ |
| 71 double ceilToDouble(); |
| 72 |
| 73 /** Returns `this.toDouble()`. */ |
| 74 double truncateToDouble(); |
| 75 |
| 64 /** | 76 /** |
| 65 * Returns a representation of this [int] value. | 77 * Returns a representation of this [int] value. |
| 66 * | 78 * |
| 67 * It should always be the case that if [:i:] is an [int] value, | 79 * It should always be the case that if [:i:] is an [int] value, |
| 68 * then [:i == int.parse(i.toString()):]. | 80 * then [:i == int.parse(i.toString()):]. |
| 69 */ | 81 */ |
| 70 String toString(); | 82 String toString(); |
| 71 | 83 |
| 72 /** | 84 /** |
| 73 * Converts [this] to a string representation in the given [radix]. | 85 * Converts [this] to a string representation in the given [radix]. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 97 * | 109 * |
| 98 * If the [source] is not a valid integer literal, optionally prefixed by a | 110 * If the [source] is not a valid integer literal, optionally prefixed by a |
| 99 * sign, the [onError] is called with the [source] as argument, and its return | 111 * sign, the [onError] is called with the [source] as argument, and its return |
| 100 * value is used instead. If no [onError] is provided, a [FormatException] | 112 * value is used instead. If no [onError] is provided, a [FormatException] |
| 101 * is thrown. | 113 * is thrown. |
| 102 */ | 114 */ |
| 103 external static int parse(String source, | 115 external static int parse(String source, |
| 104 { int radix, | 116 { int radix, |
| 105 int onError(String source) }); | 117 int onError(String source) }); |
| 106 } | 118 } |
| OLD | NEW |