mardi 14 mars 2023

Haskell Random: Same code, different machines, different result

I'm testing my code with pseudo-random number generator with the same seed on my PC (Ubuntu) and on remote server (FreeBSD) and these are the results.

My PC (ghci 8.8.4):

> Prelude> import System.Random
> Prelude System.Random> let (elemIdx, newGen) = randomR (0, 199) (mkStdGen 40)
> Prelude System.Random> elemIdx
94

Server (ghci 7.6.3):

> Prelude> import System.Random
> Prelude System.Random> let (elemIdx, newGen) = randomR (0, 199) (mkStdGen 40)
> Prelude System.Random> elemIdx
43

Strangely enough I'm getting different results (94 my PC, 43 server) with same seed. What could be causing this behavior?




Aucun commentaire:

Enregistrer un commentaire