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

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

Issue 834323002: 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, 11 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
« no previous file with comments | « runtime/lib/integers.dart ('k') | no next file » | 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 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 /** Returns this integer to the power of [exponent] modulo [modulus]. */
107 int modPow(int exponent, int modulus);
108
106 /** Returns true if and only if this integer is even. */ 109 /** Returns true if and only if this integer is even. */
107 bool get isEven; 110 bool get isEven;
108 111
109 /** Returns true if and only if this integer is odd. */ 112 /** Returns true if and only if this integer is odd. */
110 bool get isOdd; 113 bool get isOdd;
111 114
112 /** 115 /**
113 * Returns the minimum number of bits required to store this integer. 116 * Returns the minimum number of bits required to store this integer.
114 * 117 *
115 * The number of bits excludes the sign bit, which gives the natural length 118 * 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] 272 * value is used instead. If no [onError] is provided, a [FormatException]
270 * is thrown. 273 * is thrown.
271 * 274 *
272 * The [onError] function is only invoked if [source] is a [String]. It is 275 * The [onError] function is only invoked if [source] is a [String]. It is
273 * not invoked if the [source] is, for example, `null`. 276 * not invoked if the [source] is, for example, `null`.
274 */ 277 */
275 external static int parse(String source, 278 external static int parse(String source,
276 { int radix, 279 { int radix,
277 int onError(String source) }); 280 int onError(String source) });
278 } 281 }
OLDNEW
« no previous file with comments | « runtime/lib/integers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698