Chromium Code Reviews| 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 fixnum; | 5 part of fixnum; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A fixed-precision integer. | 8 * A fixed-precision integer. |
| 9 */ | 9 */ |
| 10 abstract class IntX implements Comparable<IntX> { | 10 abstract class IntX implements Comparable<IntX> { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 | 121 |
| 122 /** Returns `true` if and only if this integer is zero. */ | 122 /** Returns `true` if and only if this integer is zero. */ |
| 123 bool get isZero; | 123 bool get isZero; |
| 124 | 124 |
| 125 int get hashCode; | 125 int get hashCode; |
| 126 | 126 |
| 127 /** Returns the absolute value of this integer. */ | 127 /** Returns the absolute value of this integer. */ |
| 128 IntX abs(); | 128 IntX abs(); |
| 129 | 129 |
| 130 /** Clamps this integer to be in the range [lowerLimit] - [upperLimit]. */ | 130 /** Clamps this integer to be in the range [lowerLimit] - [upperLimit]. */ |
| 131 IntX clamp(IntX lowerLimit, IntX upperLimit); | 131 IntX clamp(lowerLimit, upperLimit); |
|
sra1
2016/03/24 20:50:34
It would be an improvement if the strong mode warn
Leaf
2016/03/24 20:52:49
Acknowledged.
| |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Returns the minimum number of bits required to store this integer. | 134 * Returns the minimum number of bits required to store this integer. |
| 135 * | 135 * |
| 136 * The number of bits excludes the sign bit, which gives the natural length | 136 * The number of bits excludes the sign bit, which gives the natural length |
| 137 * for non-negative (unsigned) values. Negative values are complemented to | 137 * for non-negative (unsigned) values. Negative values are complemented to |
| 138 * return the bit position of the first bit that differs from the sign bit. | 138 * return the bit position of the first bit that differs from the sign bit. |
| 139 * | 139 * |
| 140 * To find the the number of bits needed to store the value as a signed value, | 140 * To find the the number of bits needed to store the value as a signed value, |
| 141 * add one, i.e. use `x.bitLength + 1`. | 141 * add one, i.e. use `x.bitLength + 1`. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 */ | 226 */ |
| 227 String toHexString(); | 227 String toHexString(); |
| 228 | 228 |
| 229 /** | 229 /** |
| 230 * Returns a string representing the value of this integer in the given radix. | 230 * Returns a string representing the value of this integer in the given radix. |
| 231 * | 231 * |
| 232 * [radix] must be an integer in the range 2 .. 16, inclusive. | 232 * [radix] must be an integer in the range 2 .. 16, inclusive. |
| 233 */ | 233 */ |
| 234 String toRadixString(int radix); | 234 String toRadixString(int radix); |
| 235 } | 235 } |
| OLD | NEW |