note
arthas
<p>Hi!</p>
<p>Problem is that computers represent floating point numbers in binary; this means a decimal number can't exacly be represented in binary form, and the precision in doing this is finite. This affects <b>all</b> languages. As somebody already replied, if precision really matters to you, you need to work with integers, and perform the division as late as you can.</p>
<p>There's <a href="http://www.perldoc.com/perl5.8.0/pod/perlfaq4.html#Why-am-I-getting-long-decimals-(eg%2c-19.9499999999999)-instead-of-the-numbers-I-should-be-getting-(eg%2c-19.95)-">a perlfaq entry about this</a>, which might make things clearer to you.</p>
<p>Hope this helps!</p>
<p>Michele.</p>
304559
304559