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

Unified Diff: runtime/lib/integers.dart

Issue 12317107: ceil/floor/truncate/round return integers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Some fixes from CL 11748016. Created 7 years, 10 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..0b5b4610a1821e3938793e78053df8ec57672bc9 100644
--- a/runtime/lib/integers.dart
+++ b/runtime/lib/integers.dart
@@ -131,6 +131,11 @@ class _IntegerImplementation {
int ceil() { return this; }
int truncate() { return this; }
+ double roundToDouble() { return this.toDouble(); }
+ double floorToDouble() { return this.toDouble(); }
+ double ceilToDouble() { return this.toDouble(); }
+ double truncateToDouble() { return this.toDouble(); }
+
num clamp(num lowerLimit, num upperLimit) {
if (lowerLimit is! num) throw new ArgumentError(lowerLimit);
if (upperLimit is! num) throw new ArgumentError(upperLimit);

Powered by Google App Engine
This is Rietveld 408576698