#44803 [Opn->Bgs]: round()
| From: | felipe@php.net | Date: | Wed, 23 Apr 2008 00:47:34 +0000 |
| Subject: | #44803 [Opn->Bgs]: round() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124439@lists.php.net to get a copy of this message | ||
ID: 44803
Updated by: felipe@php.net
Reported By: oguzhanozbay at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: ýss isapi & apache 2.2
PHP Version: 5.2.5
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.
If you would like to know more about "floats" and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2008-04-22 23:41:06] oguzhanozbay at yahoo dot com
Description:
------------
How can it be!
Reproduce code:
---------------
echo round(60000000*10.5);
output 6.3E+8 !!!
echo round(60000000*(10.5));
output 6.3E+8 !!!
echo round(60000000*(10.5),2);
output 6.3E+8 !!!
echo round(70000000*(10.5));
output 7.35E+8 !!!
echo round(70000000*(11.5),2);
output 805000000 => true
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44803&edit=1