#41811 [Opn->Bgs]: round() for large numbers ending with zeroes
| From: | tony2001@php.net | Date: | Tue, 26 Jun 2007 11:43:55 +0000 |
| Subject: | #41811 [Opn->Bgs]: round() for large numbers ending with zeroes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114266@lists.php.net to get a copy of this message | ||
ID: 41811
Updated by: tony2001@php.net
Reported By: psvob01 at seznam dot cz
-Status: Open
+Status: Bogus
Bug Type: *Math Functions
Operating System: Linux
PHP Version: 5.2.3
New Comment:
round() returns float, which is printed using scientifica notation.
Expected behaviour.
Previous Comments:
------------------------------------------------------------------------
[2007-06-26 11:35:43] psvob01 at seznam dot cz
Description:
------------
Description:
------------
when you round(2400000) or other large numbers ending with zeroes, php
automatically translates it with scientific notation, which is
incorrect; the number should stay unchanged unless it exceeds precision
parameter, set in php.ini. Rounding for large numbers ending with
non-zero number, i.e. round(2400001) works OK.
Reproduce code:
---------------
<?
echo round(2400000);
?>
Expected result:
----------------
outputs "2400000"
Actual result:
--------------
outputs "2.4E+6"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41811&edit=1