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

Unified Diff: runtime/lib/integers.dart

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 12 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
Index: runtime/lib/integers.dart
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart
index 2b3a1ee768fd8204de05ef5eea9c8cb35ae3f9c9..d39d733219e121e1d72e71b49e9054b512c3dca6 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -114,7 +114,7 @@ class _IntegerImplementation {
} else {
// If abs(other) > MAX_EXACT_INT_TO_DOUBLE, then other has an integer
// value (no bits below the decimal point).
- other = d.toInt();
+ other = d.truncate();
}
}
if (this < other) {
@@ -155,7 +155,6 @@ class _IntegerImplementation {
return this;
}
- int toInt() { return this; }
double toDouble() { return new _Double.fromInteger(this); }
int pow(int exponent) {
@@ -164,7 +163,7 @@ class _IntegerImplementation {
// Use Bigint instead.
throw "_IntegerImplementation.pow not implemented for large integers.";
}
- return res.toInt();
+ return res.truncate();
}
String toStringAsFixed(int fractionDigits) {

Powered by Google App Engine
This is Rietveld 408576698