4 ms·
It's a random-number generator. It's not supposed to have expected behavior.
by geofft 11y ago
It's a random-number generator. It's not supposed to have expected behavior.
- TheOtherHobbes 11y agoIf it's a seedable generator, it certainly is. There are applications in creative coding and gaming where it's critical to have a reproducible random sequence that gives the same results on all platforms.
- jjuhl 11y agoBut Math.random() never promised to be that (reproducible that is). So changing the underlying algorithm is just fine.
- dchest 11y agoIt's is not seedable.
- alanh 11y ago> reproducible random sequence That’s a hell of an oxymoron. Edit Yes, I know obviously the intent was to refer to a pseudorandom sequence, but that’s not what was said. It’s also not what Math.random promises. It promises random-seeming output, nothing more, nothing less. It did not promise a cross-platform, reliably reproducible stream of pseudorandom numbers, and it would be in error to abuse a black-box "random" API by considering it to be a fully specified pseudorandom stream.
- dchest 11y agohttps://en.wikipedia.org/wiki/Pseudorandom_number_generator https://en.wikipedia.org/wiki/Pseudorandom_number_generator