#21458 [NEW]: simple calcul have strange result

From: Date: Mon, 06 Jan 2003 11:16:30 +0000
Subject: #21458 [NEW]: simple calcul have strange result
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29193@lists.php.net to get a copy of this message
From: bibifoc23@yahoo.fr Operating system: linux and windows PHP version: 4.3.0 PHP Bug Type: Scripting Engine problem Bug description: simple calcul have strange result <?php for ( $i=0.01;$i<0.2;$i+=0.01) { echo (15+$i-15)."\n"; } ?> i should have: 0.01 0.02 0.03 0.04 0.05 .... 0.19 but i get : 0.00999999999998 0.02 0.0299999999999 0.0399999999999 0.0500000000001 0.06 0.07 0.08 0.09 ... 0.19 A test on linux RedHat 6.2 and Windows 2000 SP3 -- Edit bug report at http://bugs.php.net/?id=21458&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21458&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21458&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21458&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21458&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21458&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21458&r=support Expected behavior: http://bugs.php.net/fix.php?id=21458&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21458&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21458&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21458&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21458&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21458&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21458&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21458&r=gnused

« previous php.bugs (#29193) next »