mercredi 17 juin 2020

Is the C# random number generator guaranteed to be stable?

I am writing a program which uses a lot of random numbers to generate stuff. But I want to assure that when starting with the same seed the generated content is the same. So when I create my random number like this:

Random r = new Random(seed);
int num = r.Next(); 

How is it guaranteed that num is always the same over time (means: several releases of .NET)? Is there a standardized list in the background? Or should I use my own "random list" to be sure that this will never change?




Aucun commentaire:

Enregistrer un commentaire