Skip to content

Commit ab1e16c

Browse files
committed
Specify that Math.random() includes 0 but not 1, using the inclusion and exclusion concepts
1 parent c9aaa7a commit ab1e16c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ num //represents a random integer between the minimum value (1) and the maximum
1414
// This means that there are 100 possible values that num can take on.
1515

1616
Math.random() //generates a random decimal number between 0 and 1. This means that the value of Math.random()
17-
// can be any number between 0 and 1, but it will never be exactly 1.
17+
// can be any number between 0 and 1, including 0 but not including 1.
1818

1919
Math.floor(Math.random() * (maximum - minimum + 1)) //multiplies the random decimal number generated by Math.random()
2020
// by the range of possible values (100), and then rounds down to the nearest integer using Math.floor().

0 commit comments

Comments
 (0)