#18978 [Opn->Bgs]: mathematical bug
| From: | alan_k@php.net | Date: | Tue, 20 Aug 2002 06:21:58 +0000 |
| Subject: | #18978 [Opn->Bgs]: mathematical bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17265@lists.php.net to get a copy of this message | ||
ID: 18978
Updated by: alan_k@php.net
Reported By: leocui@msn.com
-Status: Open
+Status: Bogus
Bug Type: *Math Functions
Operating System: Mandrake 8.1
PHP Version: 4.2.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://www.php.net/manual/en/language.types.float.php
Previous Comments:
------------------------------------------------------------------------
[2002-08-20 02:08:36] leocui@msn.com
There is a mathematical bug in PHP 4.0.6, 4.1.2 and 4.2.1.
When I try to run the following script:
<?php
echo "20.91-20.85=";
eCho 20.91-20.85;
echo "<br>";
echo "10.33-10.23=";
echo 10.33-10.23;
echo "<br>";
echo "20.33-20.23=";
echo 20.33-20.23;
echo "<br>";
echo "21.33-21.23=";
echo 21.33-21.23;
echo "<br>";
echo "30.33-30.23=";
echo 30.33-30.23;
echo "<br>";
I got the following result,
20.91-20.85=0.059999999999999 (Wrong)
10.33-10.23=0.1 (Right)
20.33-20.23=0.099999999999998 (Wrong)
21.33-21.23=0.099999999999998 (Wrong)
30.33-30.23=0.099999999999998 (Wrong)
Obviously it¡¯s wrong.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18978&edit=1