Chromium Code Reviews| Index: runtime/lib/integers.dart |
| =================================================================== |
| --- runtime/lib/integers.dart (revision 4405) |
| +++ 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); |
|
siva
2012/02/22 01:10:43
our Bigint to double conversion is not implemented
srdjan
2012/02/22 01:38:59
Done.
|
| + if (res.isInfinite()) { |
| + // Use Bigint instead. |
| + throw "IntegerImplementation.pow not implemented for large integers."; |
| + } |
| + return res.toInt(); |
| } |
| String toStringAsFixed(int fractionDigits) { |