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

Unified Diff: sdk/lib/math/random.dart

Issue 11367087: Added nextIntRange to dartvm and dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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/math/random.dart
diff --git a/sdk/lib/math/random.dart b/sdk/lib/math/random.dart
index efc5678bc69dd711424f659ef01b32cda049a33e..d92d91ea9fece37c78f1bc8da31c61b0273b9f4a 100644
--- a/sdk/lib/math/random.dart
+++ b/sdk/lib/math/random.dart
@@ -28,6 +28,16 @@ class Random {
abstract int nextInt(int max);
/**
+ * Generates a positive random integer uniformly distributed on the range
+ * from [min], inclusive, to [max], exclusive.
+ *
+ * Implementation note: The default implementation supports [max] values
+ * between 1 and ((1<<32) - 1) inclusive. [min] must be greater then 0
+ * and strictly less then [max].
+ */
+ abstract int nextIntRange(int min, int max);
+
+ /**
* Generates a positive random floating point value uniformly distributed on
* the range from 0.0, inclusive, to 1.0, exclusive.
*/

Powered by Google App Engine
This is Rietveld 408576698