Bug #53343 [NEW]: iteration bug with variable assignation

From: Date: Thu, 18 Nov 2010 10:44:10 +0000
Subject: Bug #53343 [NEW]: iteration bug with variable assignation
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156150@lists.php.net to get a copy of this message
From: Operating system: w7 PHP version: 5.3.3 Package: *General Issues Bug Type: Bug Bug description:iteration bug with variable assignation Description: ------------ iterations give aproximation beetween two val, but . Every time there value are the same : 4.38 .. 10 Test script: --------------- for ($A = 0.8; $A < 5 * 3.1416; $A+=0.01) { echo $A."<br />"; } Expected result: ---------------- 0.08 0.09 ... 15.68 15.69 15.7 Actual result: -------------- 0.8 0.81 ... 4.36 4.37 4.38 4.3899999999999 4.3999999999999 ... 9.9899999999998 9.9999999999998 10.01 10.02 ... -- Edit bug report at http://bugs.php.net/bug.php?id=53343&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53343&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53343&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53343&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53343&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53343&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53343&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53343&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53343&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53343&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53343&r=support Expected behavior: http://bugs.php.net/fix.php?id=53343&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53343&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53343&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53343&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53343&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53343&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53343&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53343&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53343&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53343&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53343&r=mysqlcfg

« previous php.bugs (#156150) next »