Is rand guaranteed to give the same sequence of random numbers in every machine (with the same seed)?



Suppose I seed the random number generator srand(1), and then generate many pseudo-random numbers via rand. Is there a guarantee that I will always obtain the same sequence of pseudo-random numbers in different machines?


Yes, as long as they have the same version of Julia.


I think this guarantee should be stated explicitly in the documentation.


I also believe it’s garanteed, as it uses a deterministic algorithm, although the library we use (dSFMT) doesn’t explicitlly mention that on their website (unless I missed it). On the Julia side, the only difference would be due to how we define Int: rand(Int) will depend on the architecture (calling rand(Int32) or rand(Int64)).