Skip to content

Commit 63b65ec

Browse files
committed
add comment to the explanation formed on line 4.
1 parent ca1cf85 commit 63b65ec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
88
//3.math.random()*100 returns random number between 0 and 100, what actually
99
// happens is that math.randum gives out random number from 0 to 1 which 1 is
1010
// not included and in this case, multiply the output by 100.
11-
//4.math.floor()it rounds a number to thier nearest integer, which means it drops all the decimal.
11+
//4.math.floor() gives out the largest intiger which is less than or equal to
12+
// the given number,which is decimal, which means it drops all the decimal. forexample if
13+
// the output is 69.5, it compares 69 with 69.5.The output will be 69 which is the largest Integer.
1214
//5.at the end we add 1 which is the minimum.
1315
console.log(num);

0 commit comments

Comments
 (0)