Adding fractions number yields different result in PHP
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3385685/php-unexpected-result-of-float-to-int-type-cast">PHP unexpected result of float to int type cast</a><br>
  <a href="http://stackoverflow.com/questions/6439140/int0-10-710-7-in-several-languages-how-to-prevent-this">int((0.1+0.7)*10) = 7 in several languages. How to prevent this?</a>  </p>
</blockquote>



<p>Can someone explain me this???</p>

<pre><code>&lt;?php
echo (int) ((0.1 + 0.7)*10);//displays an output: `7`
?&gt;
</code></pre>

<p>I was expecting to see <code>8</code> but I got <code>7</code> - please explain this behavior.</p>

<p>Is this a special feature from <code>PHP</code>? Or I didn't understand the integer type in <code>PHP</code>?</p>

<p>Thanks.</p>
