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

Side by Side Diff: sdk/lib/core/int.dart

Issue 896393004: Add modPow(int exponent, int modulus) method to int abstract class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
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 dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An arbitrarily large integer. 8 * An arbitrarily large integer.
9 * 9 *
10 * **Note:** When compiling to JavaScript, integers are 10 * **Note:** When compiling to JavaScript, integers are
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 * Shift the bits of this integer to the right by [shiftAmount]. 96 * Shift the bits of this integer to the right by [shiftAmount].
97 * 97 *
98 * Shifting to the right makes the number smaller and drops the least 98 * Shifting to the right makes the number smaller and drops the least
99 * significant bits, effectively doing an integer division by 99 * significant bits, effectively doing an integer division by
100 *`pow(2, shiftIndex)`. 100 *`pow(2, shiftIndex)`.
101 * 101 *
102 * It is an error of [shiftAmount] is negative. 102 * It is an error of [shiftAmount] is negative.
103 */ 103 */
104 int operator >>(int shiftAmount); 104 int operator >>(int shiftAmount);
105 105
106 /**
107 * Returns this integer to the power of [exponent] modulo [modulus].
108 *
109 * It is an error if [exponent] is negative or if [modulus] is
110 * negative or zero.
Lasse Reichstein Nielsen 2015/02/06 19:57:04 I think we have migrated to writing this as: Th
regis 2015/02/06 21:46:54 Done.
111 */
112 int modPow(int exponent, int modulus);
113
106 /** Returns true if and only if this integer is even. */ 114 /** Returns true if and only if this integer is even. */
107 bool get isEven; 115 bool get isEven;
108 116
109 /** Returns true if and only if this integer is odd. */ 117 /** Returns true if and only if this integer is odd. */
110 bool get isOdd; 118 bool get isOdd;
111 119
112 /** 120 /**
113 * Returns the minimum number of bits required to store this integer. 121 * Returns the minimum number of bits required to store this integer.
114 * 122 *
115 * The number of bits excludes the sign bit, which gives the natural length 123 * The number of bits excludes the sign bit, which gives the natural length
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 * value is used instead. If no [onError] is provided, a [FormatException] 277 * value is used instead. If no [onError] is provided, a [FormatException]
270 * is thrown. 278 * is thrown.
271 * 279 *
272 * The [onError] function is only invoked if [source] is a [String]. It is 280 * The [onError] function is only invoked if [source] is a [String]. It is
273 * not invoked if the [source] is, for example, `null`. 281 * not invoked if the [source] is, for example, `null`.
274 */ 282 */
275 external static int parse(String source, 283 external static int parse(String source,
276 { int radix, 284 { int radix,
277 int onError(String source) }); 285 int onError(String source) });
278 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698