|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-31 16:36 UTC] webmaster at hackquest dot 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 14:00:01 2026 UTC |
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.Reopened this bug. My understanding of this that it counts to (inclusive) 0.: Extendet the script like this: <?php for ($i = 1.0; $i >= 0; $i -= 0.05) { print "my i value is '$i'\n"; } print "end of script\n"; for ($i = 10; $i >= 0; $i -= 1) { print "my i value is '$i'\n"; } print "end of script\n"; ?> the result is: bndiap56> php4-200207301200_install_alpha_tru64/bin/php php-bugs/18682.php Unaligned access pid=146367 <php> va=0x14005e3ec pc=0x1201c6910 ra=0x1201c6904 inst=0xb4010000 my i value is '1' my i value is '0.95' my i value is '0.9' my i value is '0.85' my i value is '0.8' my i value is '0.75' my i value is '0.7' my i value is '0.65' my i value is '0.6' my i value is '0.55' my i value is '0.5' my i value is '0.45' my i value is '0.4' my i value is '0.35' my i value is '0.3' my i value is '0.25' my i value is '0.2' my i value is '0.15' my i value is '0.1' my i value is '0.05' end of script my i value is '10' my i value is '9' my i value is '8' my i value is '7' my i value is '6' my i value is '5' my i value is '4' my i value is '3' my i value is '2' my i value is '1' my i value is '0' end of script