|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-30 07:45 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Mar 03 18:00:01 2026 UTC |
Description: ------------ I wrote a function to match a number and return result. But it seem like not working then certain integer is assigned. It should return "hello world" When the loop value match 0.06, but it doesn't. But it works is other value assigned. For ecample 0.01, 0.02, 0.10 and etc. Reproduce code: --------------- function testing($selection = 0) { for ($i = 0; $i <= 0.20; $i = $i + 0.01) { if($i == $selection) { echo 'hello world'; } } } testing(0.06); Expected result: ---------------- hello world