Re: Stuck... Long day I think.. ;-)

From: Date: Fri, 16 May 2003 23:43:59 +0000
Subject: Re: Stuck... Long day I think.. ;-)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-147994@lists.php.net to get a copy of this message
On Fri, 2003-05-16 at 19:19, Frappy John wrote: > > I do the same thing here and it works fine: > > > > for($i = 250; $i <= 1000; $i += 250) { > > $c_val[] = $i; > > } > . . . > > I'm not seeing the difference in terms of functionality. > > One big difference is your protein routine deals with > decimals (floating point) and your calories routine deals > with whole numbers (integers). > > One general rule of thumb is never to test a floating point > number for equality. Ah, I did not know that, thanks. So any suggestions for how to approach this then? I guess I need to convert those values to something else and test them?? > > > I can not get ($v != $_POST['protein']) to evaluate as > > true. > > I would think it would *always* evaluate as true (i.e. > always != ). Is that what you meant to say? Yup, that's what I meant, like I said, "long day"... ;-)

« previous php.general (#147994) next »