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