jeudi 16 juillet 2015

How do I generate a random uint with a maximum?

How in C# can I generate a pseudorandom uint with some maximum? (A minimum is not needed.) There seem to be plenty of questions asking for a fully random one, but nothing with an upper limit.

Clarification: This upper limit may be greater than int.MaxValue, so just casting Random.Next(int) does not help.




Aucun commentaire:

Enregistrer un commentaire