admin管理员组文章数量:1431955
Since I've been studying Computer Science, whenever random numbers e up, it's always Mersenne Twister. There's never even a question, no alternative. Just, use Mersenne Twister.
So what does JavaScript's Math.random use? It seems like it ought to use Mersenne Twister, since it's apparently without peer, but I can't find any reference to whether it does or not.
Does anyone know what it relies on, and/or why it isn't MT, if that's the case?
Since I've been studying Computer Science, whenever random numbers e up, it's always Mersenne Twister. There's never even a question, no alternative. Just, use Mersenne Twister.
So what does JavaScript's Math.random use? It seems like it ought to use Mersenne Twister, since it's apparently without peer, but I can't find any reference to whether it does or not.
Does anyone know what it relies on, and/or why it isn't MT, if that's the case?
Share Improve this question asked Apr 28, 2012 at 7:17 temporary_user_nametemporary_user_name 37.2k48 gold badges161 silver badges243 bronze badges 1- Quantum puting offers algorithms that can generate more "natural" random numbers. [Theoretically] – KBN Commented Apr 28, 2012 at 7:24
1 Answer
Reset to default 7It's likely implementation specific. The ECMAScript specification does not force any algorithm, so a Linux JavaScript implementation might very well use /dev/urandom
.
本文标签: javascriptWhat algorithm does Mathrandom useStack Overflow
版权声明:本文标题:javascript - What algorithm does Math.random use? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745595242a2665438.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论