#47389 [NEW]: With a for, after a while it miscounts.
| From: | php at mycel dot nl | Date: | Sat, 14 Feb 2009 20:57:41 +0000 |
| Subject: | #47389 [NEW]: With a for, after a while it miscounts. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-133833@lists.php.net to get a copy of this message | ||
From: php at mycel dot nl
Operating system: Ubuntu
PHP version: 5.2.9RC2
PHP Bug Type: Variables related
Bug description: With a for, after a while it miscounts.
Description:
------------
With a for, if you count to 100, it will miscounts after a while.
(with other computers it wil miscount earlier)
Reproduce code:
---------------
for ($i = 0; $i <= 800; $i += 0.01)
{
echo $i.'<br/>';
}
Expected result:
----------------
709.23
709.24
709.25
709.26
709.27
709.28
709.29
Actual result:
--------------
709.23
709.24
709.25
709.259999999
709.269999999
709.279999999
709.289999999
--
Edit bug report at http://bugs.php.net/?id=47389&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47389&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47389&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47389&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47389&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47389&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47389&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47389&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47389&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47389&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47389&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47389&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47389&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47389&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47389&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47389&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47389&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47389&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47389&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47389&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47389&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47389&r=mysqlcfg