ID: 26954
Updated by: [EMAIL PROTECTED]
Reported By: choikh at oms dot cc
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: window, linux
PHP Version: 4.3.4
New Comment:
Floating point values have a limited precision. Hence a value might
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly
printing it without any mathematical operations.
Thank you for your interest in PHP.
/
Previous Comments:
------------------------------------------------------------------------
[2004-01-18 09:54:49] choikh at oms dot cc
Description:
------------
bug sample
<?
$tot = 0.3;
for($i=0;$i < 3; $i++)
{
echo("==> $tot, ");
$tot -= 0.1;
echo("==> $tot<br>");
}
?>
result
==> 0.3, ==> 0.2
==> 0.2, ==> 0.1
==> 0.1, ==> -2.77555756156E-017
why ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26954&edit=1