PHP 4.0 Bug #9692: Subtraction result below 100 yields wrong decimal output
| From: | bhavint at directi dot com | Date: | Mon, 12 Mar 2001 05:41:11 +0000 |
| Subject: | PHP 4.0 Bug #9692: Subtraction result below 100 yields wrong decimal output | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48701@lists.php.net to get a copy of this message | ||
From: bhavint@directi.com
Operating system: Linux
PHP version: 4.0.4pl1
PHP Bug Type: Math related
Bug description: Subtraction result below 100 yields wrong decimal output
Please check http://www.transecute.com/~kalpesh/check.php4
In case (1) I subtract a number from another which should output '0.9' but insted outputs
'0.90000000000009'
In case (2) I subtract a number from another and it gives correct output
This behaviour has been noticed if the result of the subtraction is greater than 100. I have also
published my PHPINFO output on the same page for your reference.
This bug is quite dangerous (especially for us when we are dealing with financial calculations for
our payment gateway using PHP) since all our reports dont tally at the end of the day by tiny
figures such as this.
--
Edit Bug report at: http://bugs.php.net/?id=9692&edit=1