Skip to content

Commit 3aa28fa

Browse files
committed
Amend the range explanation using the notation
1 parent a4ffc85 commit 3aa28fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
88
// It will help to think about the order in which expressions are evaluated
99
// Try logging the value of num and running the program several times to build an idea of what the program is doing
1010

11-
// num represents a random number in an inclusive range from 1 to 100
11+
// num represents a random number in the interval [1,100]
1212
// First, it starts with 100 - 1 + 1, which is equals to 100
13-
// Secondly, it multiply with Math.random(), which the function returns any number between 0 and 1, inclusive.
13+
// Secondly, it multiply with Math.random(), which the function returns any number in the interval [0,1]
1414
// Thirdly, Math.floor() rounds down and returns the largest integer less than or equal to a given number
15-
// Finally, it adds 1
15+
// Finally, it adds 1

0 commit comments

Comments
 (0)