
Math.random() and 32-bit precision - jandem
http://jandemooij.nl/blog/2015/11/27/math-random-and-32-bit-precision/
======
kijin
It's nice to make full use of all the significant bits in a double-precision
float, but I don't think it matters much in typical use cases.

Mike Malone's original code sample [1] uses only 6 bits from each invocation
of Math.random(). Most people who use the multiply-and-floor method to obtain
a random integer are probably using no more than 31 bits, either.

On the other hand, even the full 53 bits is woefully insufficient for unique
identifiers or any serious cryptographical purposes, where you need at least
128 bits to be safe. So you'll still need to call Math.random() multiple
times.

[1] [https://medium.com/@betable/tifu-by-using-math-
random-f1c308...](https://medium.com/@betable/tifu-by-using-math-
random-f1c308c4fd9d)

