<p>I read somewhere once that the modulus operator is inefficient on small embedded devices like 8 bit micro-controllers that do not have integer division instruction. Perhaps someone can confirm this but I thought the difference is 5-10 time slower than with an integer division operation.</p>

<p>Is there another way to do this other than keeping a counter variable and manually overflowing to 0 at the mod point?<p></p>

<pre><code>const int FIZZ = 6;
for(int x = 0; x &lt; MAXCOUNT; x++)
{
    if(!(x % FIZZ)) print("Fizz\n"); // slow on some systems
}
</code></pre>

<p>vs:</p>

<p>The way I am currently doing it:</p>

<pre><code>const int FIZZ = 6;
int fizzcount = 1;
for(int x = 1; x &lt; MAXCOUNT; x++)
{
    if(fizzcount &gt;= FIZZ) 
    {
        print("Fizz\n");
        fizzcount = 0;
    }
}
</code></pre>

In the embedded world, the "modulus" operations you need to do are often the ones that break down nicely into bit operations that you can do with
```
&
```
,
```
|
```
and sometimes
```
>>
```
.