You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 20ea364
Browse filesBrowse the repository at this point in the historyBrowse files
// This expression can be simplified as (100 - 1 + 1), which equals 100. This tells the program how many possible whole numbers there are. There are 100 possibilities.
17
17
// The +1 is important as without it, we would only reach 99 possibilities, that is 0 - 99.
18
18
//-Math.random() * (maximum - minimum + 1):
19
-
// This function multiplies the random fraction by the range size. Since Math.random() represents numbers >=0 and <1, this expression produces value anywhere from 0 up to 100, excluding 100.
20
-
// Example to justify expression: 0.876 * 100 = 87.6
19
+
// This function multiplies the random decimal by the range size. Since Math.random() represents numbers >=0 and <1, this expression produces value anywhere from 0 up to 100, excluding 100.
20
+
// Example to justify expression: 0.876 * 100 = 87.6
21
+
//-Math.floor: This static method rounds down to the nearest whole number, discarding the decimal. This turns the continuous range into whole numbers, from 0 - 99.
0 commit comments