#18682 [Opn->Csd]: for loop with floats causes roundup problem
| From: | kalowsky@php.net | Date: | Wed, 31 Jul 2002 21:51:59 +0000 |
| Subject: | #18682 [Opn->Csd]: for loop with floats causes roundup problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15715@lists.php.net to get a copy of this message | ||
ID: 18682
Updated by: kalowsky@php.net
Reported By: webmaster@hackquest.com
-Status: Open
+Status: Closed
Bug Type: Variables related
Operating System: Linux
PHP Version: 4.2.2
New Comment:
Works for me on OSX just fine:
for ($i = 1.0; $i >= 0; $i -= 0.05)
{
print "my i value is '$i'\n";
}
print "end of script\n";
please post a full sample script if this continues.
Previous Comments:
------------------------------------------------------------------------
[2002-07-31 16:36:34] webmaster@hackquest.com
for ($i = 1.0; $i >= 0; $i -= 0.05)
Will produce the line:
..
..
0.1
0.05
The 0 is missing, obviously its rounded to below zero somehow, and then
gets discarded.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18682&edit=1