Math.random() never returns 1.0, so this API should be the same. This avoids bias when truncating to integers after multiplying: Math.floor(Math.random() * 6) + 1 will never be 7.
From the wording I think this is just a typo in the proposal, because it suggests it is the same as Math.random;
These values must approximate a uniform distribution over the range [0,1], same as Math.random().
Math.random()
never returns 1.0, so this API should be the same. This avoids bias when truncating to integers after multiplying:Math.floor(Math.random() * 6) + 1
will never be 7.From the wording I think this is just a typo in the proposal, because it suggests it is the same as
Math.random
;The range should be
[0,1)