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

Unified Diff: sdk/lib/core/int.dart

Issue 113833002: Add num.sign getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changed to return same type as the number (double for doubles, int for ints). Returns -0.0 for -0.0… Created 7 years 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: sdk/lib/core/int.dart
diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart
index 6ca271829d00c7329a918600f6acf9f92951e439..23eda314290b52f11aa2aa4b216e43a12d6b5cf5 100644
--- a/sdk/lib/core/int.dart
+++ b/sdk/lib/core/int.dart
@@ -196,6 +196,14 @@ abstract class int extends num {
*/
int abs();
+ /**
+ * Returns the sign of this integer.
+ *
+ * Returns 0 for zero, -1 for values less than zero and
+ * +1 for values greater than zero.
+ */
+ int get sign;
+
/** Returns `this`. */
int round();

Powered by Google App Engine
This is Rietveld 408576698