Bug #13671 Updated: error of subtraction
| From: | hholzgra@php.net | Date: | Mon, 15 Oct 2001 12:51:48 +0000 |
| Subject: | Bug #13671 Updated: error of subtraction | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67954@lists.php.net to get a copy of this message | ||
ID: 13671
Updated by: hholzgra
Reported By: c.bolerichard@fabi.fr
Status: Bogus
Bug Type: *Math Functions
Operating System: linux
PHP Version: 4.0.5
New Comment:
see also the note on floating point precision on
http://www.php.net/manual/en/language.types.float.php
Previous Comments:
------------------------------------------------------------------------
[2001-10-15 08:49:00] derick@php.net
They are fine, this is how floating point numbers work. You store ~1.12 and ~1.13, not exactly 1.12
and 1.13.
Not a bug.
Derick
------------------------------------------------------------------------
[2001-10-15 08:28:16] c.bolerichard@fabi.fr
These subtractions are false :
$r1 = 1.13 - 1.12;
$r2 = 1.12 - 1.13;
echo "$r1"; /* return : 0.0099999999999998 */
echo "$r2"; /* return : -0.0099999999999998 */
Why ?
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13671&edit=1