Skip to content

Commit 2451b3e

Browse files
committed
update to Random example
1 parent b37d788 commit 2451b3e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

sdk/lib/math/random.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ part of dart.math;
1717
/// var value = Random().nextInt(10); // Value between 0 - 9.
1818
/// value = Random().nextInt(100) + 50; // Value between 50 - 149
1919
/// ```
20-
/// To create a random boolean value, use [nextBool].
21-
/// ```dart
22-
/// var value = Random().nextBool(); // Value is true or false.
23-
/// ```
24-
/// To create random floating point value, use [nextDouble].
25-
/// ```dart
26-
/// var value = Random().nextDouble(); // Value between 0.0 - 1.0.
20+
/// To create a non-negative random floating point value uniformly distributed
21+
/// in the range from 0.0, inclusive, to 1.0, exclusive, use [nextDouble].
22+
/// ```dart continued
23+
/// value = Random().nextDouble(); // Value between 0.0 - 1.0.
2724
/// value = Random().nextDouble() + 10; // Value is >= 10.0 and < 11.0
2825
/// ```
26+
/// To create a random boolean value, use [nextBool].
27+
/// ```dart continued
28+
/// value = Random().nextBool(); // Value is true or false.
29+
/// ```
2930
abstract class Random {
3031
/// Creates a random number generator.
3132
///

0 commit comments

Comments
 (0)