Re: One Bug Left...

From: Date: Fri, 30 Jun 2000 12:09:46 +0000
Subject: Re: One Bug Left...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4004@lists.php.net to get a copy of this message
<= (less than or equal to). Stick some ='s in there if you want equality. hope this helps Ryan On Thu, Jun 29, 2000 at 02:56:44PM -0700, Ben Ocean wrote: > Hi; > I've got a bug here I can't spot... > if ($age < 2) { > $agezh = 0; > } elseif ($age < 4) { > $agezh = 1; > } elseif ($age < 7) { > $agez = 2; > } else { > $agezh = 3; > } > Now, $age is a real number (like 1.23456789) and it is the actual age of > the horse (checked it through *echo* lines of code), but for *some reason* > usually (but not always) when $age actually is less than or equal to the > number 2, it does not satisfy the condition. What am I missing here? > TIA, > BenO > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ---end quoted text---

« previous php.general (#4004) next »