Re: Bug?

From: Date: Wed, 08 Aug 2001 09:30:41 +0000
Subject: Re: Bug?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61781@lists.php.net to get a copy of this message
i found this http://www.php.net/manual/en/language.types.double.php#warn.float-precision it explains the problem <?php $q = ((8.85-8)*100); echo $q."<br>"; echo (float)($q)."<br>"; echo (int)($q)."<br>"; echo var_dump($q)."<br>"; ?> gives out 85 85 84 float(85) ----- Original Message ----- From: "Darius Ivanauskas" <darius@nomagiclt.com> To: "Maxim Maletsky" <maxim@japaninc.com> Cc: "'[Intent A/S] Tais M. Hansen'" <tmh@intent.dk>; <php-general@lists.php.net> Sent: Wednesday, August 08, 2001 7:18 PM Subject: RE: [PHP] Bug? > Hello, > > You shodld read > http://www.php.net/manual/en/language.types.double.php and > http://www.php.net/manual/en/language.types.integer.php#language.types.integ er.casting > > > Regards, > -- > Darius Ivanauskas > > On Wed, 8 Aug 2001, Maxim Maletsky wrote: > > > good point. > > > > ...and try this out: > > > > > > echo (int)((8.85-8)*100).'<br>'; > > echo ((8.85-8)*100).'<br>'; > > > > > > Kinda weird, > > can anyone explain? > > > > > > Thanks, > > Maxim Maletsky > > > > > > > > -----Original Message----- > > From: [Intent A/S] Tais M. Hansen [mailto:tmh@intent.dk] > > Sent: Wednesday, August 08, 2001 4:49 PM > > To: php-general@lists.php.net > > Subject: [PHP] Bug? > > > > > > Hi! > > > > I just came across this weird thing. Bug? You tell me! > > > > print (int)((8.85-8)*100); > > > > I would think the line above would print "85". But for some reason, it > > prints "84"?? Can anyone tell me why that is? > > > > -- > > Intent A/S > > Tais M. Hansen > > Web Developer > > > > > > > > > > -- > > 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 > > > > -- > > 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 > > > > > -- > 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 >

« previous php.general (#61781) next »