The mathRandom() function returns a floating-point, pseudo-random number in the range 0 to less than 1
(inclusive of 0, but not 1) with approximately uniform distribution over that range.
Since
0.12.0
Returns
A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive).
Example
mathRandom(); // a random number between 0 and 1 mathRandom() * 10; // a random number between 0 and 10 Math.floor(mathRandom() * 100); // a random integer between 0 and 99
The
mathRandom()
function returns a floating-point, pseudo-random number in the range 0 to less than 1 (inclusive of 0, but not 1) with approximately uniform distribution over that range.Since
0.12.0
Returns
A floating-point, pseudo-random number between 0 (inclusive) and 1 (exclusive).
Example