Re: Mistical 17.49 (possible bug)

From: Date: Wed, 07 Aug 2002 15:02:53 +0000
Subject: Re: Mistical 17.49 (possible bug)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-111518@lists.php.net to get a copy of this message
Rounding is a solution but. echo (995 % 100) . "<br>"; // result 95 echo (((995 / 100) * 100) % 100) . "<br>"; // result 94 echo ((995 / 100) * 100) . "<br>"; // result 995, not 994.99999999 > Rounding. > 17.49*100 can be 1748.99999999, and the rest is 48 > > Andrey > > ----- Original Message ----- > From: "Ipa" <ipa@beta.lt> > To: <php-general@lists.php.net> > Sent: Wednesday, August 07, 2002 5:46 PM > Subject: [PHP] Mistical 17.49 (possible bug) > > > > Good day. > > > > Can anybogy explain this trick. > > > > <?php > > echo (1749 % 100) . "<br>"; > > echo ((17.49 * 100) % 100) . "<br>"; > > ?> > > result should be the same isn't it ? > > but output is : > > > > 49 > > 48 > > > > ???? ;)))) > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >

« previous php.general (#111518) next »