There was an error while loading. Please reload this page.
1 parent ca1cf85 commit 63b65ecCopy full SHA for 63b65ec
1 file changed
Sprint-2/1-key-exercises/4-random.js
@@ -8,6 +8,8 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
8
//3.math.random()*100 returns random number between 0 and 100, what actually
9
// happens is that math.randum gives out random number from 0 to 1 which 1 is
10
// 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.
+//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.
14
//5.at the end we add 1 which is the minimum.
15
console.log(num);
0 commit comments