What algorithm does Math.random use?

前端 未结 1 1705
温柔的废话
温柔的废话 2020-12-21 01:38

Since I\'ve been studying Computer Science, whenever random numbers come up, it\'s always Mersenne Twister. There\'s never even a question, no alternative. Just, use Mersenn

1条回答
  •  时光说笑
    2020-12-21 02:28

    It's likely implementation specific. The ECMAScript specification does not force any algorithm, so a Linux JavaScript implementation might very well use /dev/urandom.

    0 讨论(0)
提交回复
热议问题