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

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

Issue 28973002: Add isFinite getter to num. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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: sdk/lib/core/num.dart
diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart
index 1ef0e16e8dece8d0bc1eb033718785c6a69781e6..d61a0244a505175c17acf42457c572fc20ea7c37 100644
--- a/sdk/lib/core/num.dart
+++ b/sdk/lib/core/num.dart
@@ -142,12 +142,28 @@ abstract class num implements Comparable<num> {
/** Relational greater than or equal operator. */
bool operator >=(num other);
+ /** Whether the number is the double Not-a-Number value. */
bool get isNaN;
+ /**
+ * Whether the number is negative.
+ *
+ * Negative numbers are those less than zero, and the double `-0.0`.
+ */
bool get isNegative;
+ /**
+ * Whether the number is the double positive or negative infinity.
floitsch 2013/10/18 11:54:59 double reads bad here.
Lasse Reichstein Nielsen 2013/10/23 10:21:38 Done.
+ */
bool get isInfinite;
+ /**
+ * Whether the number is finite.
+ *
+ * The only non-finite numbers are NaN and positive or negative infinity.
floitsch 2013/10/18 11:54:59 nit. I prefer: NaN, positive infinity and negative
Lasse Reichstein Nielsen 2013/10/23 10:21:38 Done.
+ */
+ bool get isFinite;
+
/** Returns the absolute value of this [num]. */
num abs();

Powered by Google App Engine
This is Rietveld 408576698