mardi 27 décembre 2016

Most efficent modulo counter

I need simple modulo counter like: 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0...

How to proper implement this? Increment unsigned int variable and using operator% (var % 6) or increment variable and checking if it is equal to 6 then assign 0.

Aucun commentaire:

Enregistrer un commentaire