#27332 [Opn->Bgs]: wrong result
| From: | derick@php.net | Date: | Fri, 20 Feb 2004 15:45:51 +0000 |
| Subject: | #27332 [Opn->Bgs]: wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55240@lists.php.net to get a copy of this message | ||
ID: 27332
Updated by: derick@php.net
Reported By: valeriy-v at yandex dot ru
-Status: Open
+Status: Bogus
Bug Type: Math related
Operating System: windows xp
PHP Version: 4.3.4
New Comment:
Floating point values have a limited precision. Hence a value might
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly
printing it without any mathematical operations.
Thank you for your interest in PHP.
.
Previous Comments:
------------------------------------------------------------------------
[2004-02-20 10:43:56] valeriy-v at yandex dot ru
Description:
------------
<?php
echo 22512.65+0-22511.03,'<br>';
?>
will print 1.6200000000026
Reproduce code:
---------------
<?php
echo 22512.65+0-22511.03,'<br>';
?>
Expected result:
----------------
wrong result 1.6200000000026
Actual result:
--------------
1.68
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27332&edit=1