Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: lib/src/intx.dart

Issue 1834783004: Merge in changes from SDK branch (Closed) Base URL: https://github.com/dart-lang/fixnum@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/int64.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 { 10 abstract class IntX implements Comparable {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 /** Returns `true` if and only if this integer is zero. */ 124 /** Returns `true` if and only if this integer is zero. */
125 bool get isZero; 125 bool get isZero;
126 126
127 int get hashCode; 127 int get hashCode;
128 128
129 /** Returns the absolute value of this integer. */ 129 /** Returns the absolute value of this integer. */
130 IntX abs(); 130 IntX abs();
131 131
132 /** Clamps this integer to be in the range [lowerLimit] - [upperLimit]. */ 132 /** Clamps this integer to be in the range [lowerLimit] - [upperLimit]. */
133 IntX clamp(IntX lowerLimit, IntX upperLimit); 133 IntX clamp(lowerLimit, upperLimit);
134 134
135 /** 135 /**
136 * Returns the minimum number of bits required to store this integer. 136 * Returns the minimum number of bits required to store this integer.
137 * 137 *
138 * The number of bits excludes the sign bit, which gives the natural length 138 * The number of bits excludes the sign bit, which gives the natural length
139 * for non-negative (unsigned) values. Negative values are complemented to 139 * for non-negative (unsigned) values. Negative values are complemented to
140 * return the bit position of the first bit that differs from the sign bit. 140 * return the bit position of the first bit that differs from the sign bit.
141 * 141 *
142 * To find the the number of bits needed to store the value as a signed value, 142 * To find the the number of bits needed to store the value as a signed value,
143 * add one, i.e. use `x.bitLength + 1`. 143 * add one, i.e. use `x.bitLength + 1`.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 */ 228 */
229 String toHexString(); 229 String toHexString();
230 230
231 /** 231 /**
232 * Returns a string representing the value of this integer in the given radix. 232 * Returns a string representing the value of this integer in the given radix.
233 * 233 *
234 * [radix] must be an integer in the range 2 .. 16, inclusive. 234 * [radix] must be an integer in the range 2 .. 16, inclusive.
235 */ 235 */
236 String toRadixString(int radix); 236 String toRadixString(int radix);
237 } 237 }
OLDNEW
« no previous file with comments | « lib/src/int64.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698