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 * 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 /** | 81 /** |
82 * Shift the bits of this integer to the left by [shiftAmount]. | 82 * Shift the bits of this integer to the left by [shiftAmount]. |
83 * | 83 * |
84 * Shifting to the left makes the number larger, effectively multiplying | 84 * Shifting to the left makes the number larger, effectively multiplying |
85 * the number by `pow(2, shiftIndex)`. | 85 * the number by `pow(2, shiftIndex)`. |
86 * | 86 * |
87 * There is no limit on the size of the result. It may be relevant to | 87 * There is no limit on the size of the result. It may be relevant to |
88 * limit intermediate values by using the "and" operator with a suitable | 88 * limit intermediate values by using the "and" operator with a suitable |
89 * mask. | 89 * mask. |
90 * | 90 * |
91 * It is an error of [shiftAmount] is negative. | 91 * It is an error of [shiftAmount] is negative. |
regis
2015/06/24 18:29:54
of -> if
| |
92 */ | 92 */ |
93 int operator <<(int shiftAmount); | 93 int operator <<(int shiftAmount); |
94 | 94 |
95 /** | 95 /** |
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. |
regis
2015/06/24 18:29:54
of -> if
| |
103 */ | 103 */ |
104 int operator >>(int shiftAmount); | 104 int operator >>(int shiftAmount); |
105 | 105 |
106 /** | 106 /** |
107 * Returns this integer to the power of [exponent] modulo [modulus]. | 107 * Returns this integer to the power of [exponent] modulo [modulus]. |
108 * | 108 * |
109 * The [exponent] must be non-negative and [modulus] must be | 109 * The [exponent] must be non-negative and [modulus] must be |
110 * positive. | 110 * positive. |
111 */ | 111 */ |
112 int modPow(int exponent, int modulus); | 112 int modPow(int exponent, int modulus); |
113 | 113 |
114 /** | 114 /** |
115 * Returns the modular multiplicative inverse of this integer | 115 * Returns the modular multiplicative inverse of this integer |
116 * modulo [modulus]. | 116 * modulo [modulus]. |
117 * | 117 * |
118 * The [modulus] must be positive. | 118 * The [modulus] must be positive. |
119 * Throws a RangeError if no modular inverse exists. | 119 * Throws if no modular inverse exists. |
regis
2015/06/24 18:29:54
For consistency, "It is an error if ..." would hav
Lasse Reichstein Nielsen
2015/06/30 12:39:15
True.
I haven't yet decided on whether it should b
| |
120 */ | 120 */ |
121 int modInverse(int modulus); | 121 int modInverse(int modulus); |
122 | 122 |
123 /** | 123 /** |
124 * Returns the greatest common divisor of the absolute value of | 124 * Returns the greatest common divisor of the absolute value of |
125 * this integer and the absolute value of [other]. | 125 * this integer and the absolute value of [other]. |
126 * | 126 * |
127 * Both this and [other] must be non-zero. | 127 * Both this and [other] must be non-zero. |
128 */ | 128 */ |
129 int gcd(int other); | 129 int gcd(int other); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 * var value = int.parse(text, onError: (source) => null); | 301 * var value = int.parse(text, onError: (source) => null); |
302 * if (value == null) ... handle the problem | 302 * if (value == null) ... handle the problem |
303 * | 303 * |
304 * The [onError] function is only invoked if [source] is a [String]. It is | 304 * The [onError] function is only invoked if [source] is a [String]. It is |
305 * not invoked if the [source] is, for example, `null`. | 305 * not invoked if the [source] is, for example, `null`. |
306 */ | 306 */ |
307 external static int parse(String source, | 307 external static int parse(String source, |
308 { int radix, | 308 { int radix, |
309 int onError(String source) }); | 309 int onError(String source) }); |
310 } | 310 } |
OLD | NEW |