#46980 [Opn->Asn]: Rounding Error
| From: | kalle@php.net | Date: | Thu, 01 Jan 2009 02:04:47 +0000 |
| Subject: | #46980 [Opn->Asn]: Rounding Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132471@lists.php.net to get a copy of this message | ||
ID: 46980
Updated by: kalle@php.net
Reported By: gimmicklessgpt at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Math related
Operating System: Linux
PHP Version: 5.2.8
-Assigned To:
+Assigned To: cseiler
New Comment:
Christian, you were working with some rounding issues in 5.3, could you
clarrify this?
Previous Comments:
------------------------------------------------------------------------
[2008-12-31 02:00:39] gimmicklessgpt at gmail dot com
additional note:
while 0.145 rounds to 0.14 (incorrect)
0.155 rounds to 0.16 (correct)
------------------------------------------------------------------------
[2008-12-31 01:57:20] gimmicklessgpt at gmail dot com
Description:
------------
When rounding, it will round incorrectly on one certain instance for
sure. when rounding 0.145 with a precision of 2 it comes up with 0.14
Reproduce code:
---------------
echo round(0.145,2);
Expected result:
----------------
0.15
Actual result:
--------------
0.14
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46980&edit=1