mod operator behavior
<p>When I run this code:</p>

<pre><code>double d = 0.0;
for (int i = 0; i &lt; 90; i++)
{
    d += .01;
    d %= 1;
    Console.WriteLine(d);
}
</code></pre>

<p>I would expect the output to be</p>

<pre><code>0.01
0.02
0.03
...
0.9
</code></pre>

<p>It acts like that until it gets to what should be 0.81. This is the output I see:</p>

<pre><code>...
0.8
0.810000000000001
0.820000000000001
...
0.900000000000001
</code></pre>

<p>So what's going on here?</p>
