I have no idea. The linked source at
claims this: "Some of you may be curious as to why Math.floor(),
instead of Math.round(), is used in the above code. While both
successfully round off its containing parameter to an integer within
the designated range, Math.floor does so more "evenly", so the
resulting integer isn't lopsided towards either end of the number
spectrum. In other words, a more random number is returned using
It may be some actual behavior or an author's fantasy - no arguments
are given on the page. From the Math.round and Math.floor methods
Returns the value of a number rounded to the nearest integer.
Returns the largest integer less than or equal to a number.
I am failing to grasp the exact difference between of them. I only
assume that the only place of rounding inequality results could be in
"border cases" like 0.5xxxxxx etc. so with .5 being the first
fractional digit. Respectively if such inequality really exists then
there must be something with pseudo-random generation in whole or in
how it is implemented in Math.random() that would suggest 0.5xxxxx or
0.5 generation being lesser random than other results. Or it is just
another urban legend.