Bug #15164: can php do a substraction? ;)
| From: | mik at x dot org dot pl | Date: | Tue, 22 Jan 2002 14:17:33 +0000 |
| Subject: | Bug #15164: can php do a substraction? ;) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-77768@lists.php.net to get a copy of this message | ||
From: mik@x.org.pl
Operating system: linux 2.2.19
PHP version: 4.1.1
PHP Bug Type: Math related
Bug description: can php do a substraction? ;)
my previous bug report was 15162. i wrote about (int) cast there.
another bug may be a reason of that.
i do: (267.57 - 267) * 100
and i get: 57.999999999999
(i expected 57)
[may be i work too much...]
consider this:
<?
$price = 267.57;
$price_dolars = floor($price);
echo "number of cents is: " . ($price - $price_dolars)*100 . "<BR>";
?>
--
Edit bug report at: http://bugs.php.net/?id=15164&edit=1