Bug #70316 [Opn]: round function bug
| From: | laruence@php.net | Date: | Fri, 21 Aug 2015 07:18:46 +0000 |
| Subject: | Bug #70316 [Opn]: round function bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195384@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70316&edit=1
ID: 70316
Updated by: laruence@php.net
Reported by: 277460173 at qq dot com
Summary: round function bug
Status: Open
Type: Bug
Package: *General Issues
Operating System: linux nginx PHP/5.4.41
PHP Version: 5.4Git-2015-08-21 (Git)
Block user comment: N
Private report: N
New Comment:
what's the "dump" function's definition ?
Previous Comments:
------------------------------------------------------------------------
[2015-08-21 05:32:02] 277460173 at qq dot com
Description:
------------
$source=1370.72;
$local=1238.265;
$aa=($source - $local) / $source;
dump($aa);
$bb= round($aa,4);
dump($bb);
dump(phpversion());
result:
float(0.09663169721022523)
float(0.09660000000000001)
string(6) "5.4.41"
Test script:
---------------
$source=1370.72;
$local=1238.265;
$aa=($source - $local) / $source;
dump($aa);
$bb= round($aa,4);
dump($bb);
dump(phpversion());
Expected result:
----------------
float(0.09663169721022523)
float(0.0966)
string(6) "5.4.41"
Actual result:
--------------
float(0.09663169721022523)
float(0.09660000000000001)
string(6) "5.4.41"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70316&edit=1