Random numbers across different programming languages

后端 未结 3 397
刺人心
刺人心 2020-12-21 13:53

If I use the Random number generator function in different programming languages and I chose the same seed .. Do they have to give me the same random numbers ?

for e

3条回答
  •  星月不相逢
    2020-12-21 14:42

    Portability across languages is one reason to use your own random number generator. This article gives a very small random number generator whose algorithm has been vetted by experts. You can easily port the generator to any language that supports basic operations on 32-bit unsigned integers. Every implementation should return the same sequence of outputs given the same seeds.

提交回复
热议问题