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

Unified Diff: runtime/lib/integers.dart

Issue 23129005: Remove int.pow and double.pow from VM library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed Math.pow to not use int.pow,double.pow. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/lib/math.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.dart
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index aaf57126ec138570ebf9f2e05c26b4a512acdb46..dca7ef8434670a2934ac7a1de4e2777691e00248 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -163,23 +163,6 @@ class _IntegerImplementation {
int toInt() { return this; }
double toDouble() { return new _Double.fromInteger(this); }
- int pow(int exponent) {
- // Exponentiation by squaring.
- int base = this;
- int result = 1;
- while (exponent != 0) {
- if ((exponent & 1) == 1) {
- result *= base;
- }
- exponent >>= 1;
- // Skip unnecessary operation (can overflow to Mint or Bigint).
- if (exponent != 0) {
- base *= base;
- }
- }
- return result;
- }
-
String toStringAsFixed(int fractionDigits) {
return this.toDouble().toStringAsFixed(fractionDigits);
}
« no previous file with comments | « runtime/lib/double.dart ('k') | runtime/lib/math.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698