dimanche 25 octobre 2015

F# function failing to return random numbers

I'm trying to generate random numbers from a function and I noticed my function always returns the same number. The following snippet is a simplified version of what I do:

let rnd = System.Random()

   let GetRandomNumber =
      rnd.Next()

When I call function GetRandomNumber, it always returns the same number. Why? I have tried the same code in C# and the function returns a different number every time.




Aucun commentaire:

Enregistrer un commentaire