Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前需要使用一个脚本,该脚本需要 python 和 PHP 在给定种子的情况下输出相同的随机数。有没有可以让他们这样做的RNG?
当我将 mt_rand 和 mt_srand 以及 python 的默认 rng(应该是 mersenne twist)与相同的种子一起使用时,我会得到不同的结果。
绝对没有要求 Python 和 PHP(或任何其他语言)应该为相同的种子生成相同的随机数。