floated do-while index says: 0.8 < 0.8
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3957705/the-accuracy-of-php-float-calculate">The accuracy of PHP float calculate</a>  </p>
</blockquote>



<pre><code>&lt;?php
    $foo = 0;
    do {
        echo "\$foo = $foo".($foo &gt;= 0.8 ? " &gt;= 0.8&lt;br&gt;\n" : " &lt; 0.8&lt;br&gt;\n");
        $foo = $foo + 0.1;
    } while($foo &lt;= 1);
?&gt;
</code></pre>

<p>leads to the following output:</p>

<pre><code>$foo = 0 &lt; 0.8
$foo = 0.1 &lt; 0.8
$foo = 0.2 &lt; 0.8
$foo = 0.3 &lt; 0.8
$foo = 0.4 &lt; 0.8
$foo = 0.5 &lt; 0.8
$foo = 0.6 &lt; 0.8
$foo = 0.7 &lt; 0.8
$foo = 0.8 &lt; 0.8
$foo = 0.9 &gt;= 0.8
$foo = 1 &gt;= 0.8
</code></pre>

<p>.. even var_dump does not tell me more then it's 0.8. Scary:</p>

<pre><code>round($foo,1) &gt;= 0.8
</code></pre>

<p>solves the problem - help appreciated!</p>
