| Index: runtime/lib/integers.dart
|
| ===================================================================
|
| --- runtime/lib/integers.dart (revision 4418)
|
| +++ runtime/lib/integers.dart (working copy)
|
| @@ -118,7 +118,12 @@
|
| double toDouble() { return new Double.fromInteger(this); }
|
|
|
| int pow(int exponent) {
|
| - throw "IntegerImplementation.pow not implemented";
|
| + double res = this.toDouble().pow(exponent);
|
| + if (res.isInfinite()) {
|
| + // Use Bigint instead.
|
| + throw "IntegerImplementation.pow not implemented for large integers.";
|
| + }
|
| + return res.toInt();
|
| }
|
|
|
| String toStringAsFixed(int fractionDigits) {
|
| @@ -219,4 +224,8 @@
|
| int shlFromInt(int other) {
|
| throw const OutOfMemoryException();
|
| }
|
| +
|
| + int pow(int exponent) {
|
| + throw "Bigint.pow not implemented";
|
| + }
|
| }
|
|
|