#20692 [Opn->Bgs]: incrementing in for loop
| From: | derick@php.net | Date: | Thu, 28 Nov 2002 09:40:48 +0000 |
| Subject: | #20692 [Opn->Bgs]: incrementing in for loop | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-26048@lists.php.net to get a copy of this message | ||
ID: 20692
Updated by: derick@php.net
Reported By: kuba@3net.pl
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: RH Linux 7.2
PHP Version: 4.2.3
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2002-11-28 02:44:06] kuba@3net.pl
there is a problem with for loop
code:
$a=1;
$b=1.5;
$step=0.1;
for ($i=$a;$i<=$b;$i=$i+$step) {
echo "$i<BR>";
}
prints:
1
1.1
1.2
1.3
1.4
and 1.5 value is skipped
when changing this values
to $a=10;$b=15;$step=1;
everything is OK (15 is printed)
so I guess problem is with floating point values
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20692&edit=1