Re: Bug?

From: Date: Wed, 08 Aug 2001 09:18:26 +0000
Subject: Re: Bug?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-61777@lists.php.net to get a copy of this message
if you use echo (float)((8.85-8)*100); it works because 8.85 go's to 0.85 and times that by 100, and you get 85 which is what you get... ----- Original Message ----- From: "Renze Munnik" <renze@datalink.nl> To: "ReDucTor" <sjdtmv@tpg.com.au>; <php-general@lists.php.net> Sent: Wednesday, August 08, 2001 7:14 PM Subject: Re: [PHP] Bug? > On Wed, Aug 08, 2001 at 07:06:13PM +1000, ReDucTor wrote: > > you must use float not int :D > > Using float doesn't solve the problem, does it? Point is that when > using int, the damn thing doesn't get it straight. And that's WEIRD. > I mean the result of (8.85-8)*100 is already an integer and not > converting it to an integer the result is perfectly okay. > > Btw: (int)((8.85*100)-(8*100)), _does_ return a correct result. > > -- > > * R&zE: > > -- »»»»»»»»»»»»»»»»»»»»»»»» > -- Renze Munnik > -- DataLink BV > -- > -- E: renze@datalink.nl > -- W: +31 23 5326162 > -- F: +31 23 5322144 > -- M: +31 6 21811143 > -- H: +31 23 5516190 > -- > -- Stationsplein 82 > -- 2011 LM HAARLEM > -- > -- http://www.datalink.nl > -- «««««««««««««««««««««««« >

« previous php.general (#61777) next »