jeudi 26 mai 2016

the stack as the source of random numbers [duplicate]

This question already has an answer here:

I need a random unsigned number [0, max), but I don't want to call a random number generator so I thought of doing:

unsigned i;

and

i % max

in the expressions. My questions is, is this a good way to obtain a random unsigned value?




Aucun commentaire:

Enregistrer un commentaire