Why python division remainder operator just works for integer denominator? : <p>While working with the division remainder operator <strong>%</strong> in python 2.7 I faced an unexpected behavior (at least for me) when using it with decimal denominators. Bellow an example:</p>

<pre><code>&gt;&gt;&gt; 0.1%0.1
0.0                 # as expected
&gt;&gt;&gt; 0.2%0.1
0.0                 # as expected
&gt;&gt;&gt; 0.3%0.1
0.09999999999999998 # what the hell?
&gt;&gt;&gt; 0.4%0.1
0.0                 # aw expected
&gt;&gt;&gt; 0.5%0.1
0.09999999999999998 # what the hell?
</code></pre>

<p>Why the operations <strong>0.3%0.1</strong> and <strong>0.5%0.1</strong> return the result above instead of <strong>0.0</strong> as in the other cases and as I was expecting?</p>

<p>Thanks</p>
