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" <[EMAIL PROTECTED]>
To: "Maxim Maletsky" <[EMAIL PROTECTED]>
Cc: "'[Intent A/S] Tais M. Hansen'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 08, 2001 4:49 PM
> > To: [EMAIL PROTECTED]
> > 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]