Bug #61624 [Com]: round
Edit report at https://bugs.php.net/bug.php?id=61624&edit=1
ID: 61624
Comment by: gufophp at gmail dot com
Reported by: gufophp at gmail dot com
Summary: round
Status: Open
Type: Bug
Package: Math related
Operating System: win32
PHP Version: 5.4.0
Block user comment: N
Private report: N
New Comment:
php.ini
change precision to
precision = 17
Previous Comments:
------------------------------------------------------------------------
[2012-04-05 03:05:37] reeze dot xia at gmail dot com
Hi, gufophp:
I can't reproduce it in both 5.4 & 5.3 | Win7 & Mac OS X. can you feedback more
information about this?.
Thanks
------------------------------------------------------------------------
[2012-04-04 17:06:35] gufophp at gmail dot com
Description:
------------
<?php
echo round(33.29999999999999715783,4); // fail
echo "-";
echo round(33.29999999999999715783,2); // fail
echo "-";
echo round(33.29999999999999715783); //ok
echo "-";
echo round(33.29999999999999715783,-1); //ok
echo "-";
echo round(55533.29999999999999715783,-2); //ok
?>
Test script:
---------------
33.29999999999999715783-33.29999999999999715783-33-30-55500
Expected result:
----------------
33.3-33.3-33-30-55500
Actual result:
--------------
33.29999999999999715783-33.29999999999999715783-33-30-55500
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61624&edit=1
Thread (4 messages)