Doc #38573 [Com]: BCMath bcmul not round the last decimal
| From: | robert at idacmedia dot com | Date: | Fri, 03 Jun 2011 11:47:06 +0000 |
| Subject: | Doc #38573 [Com]: BCMath bcmul not round the last decimal | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6684@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=38573&edit=1
ID: 38573
Comment by: robert at idacmedia dot com
Reported by: jeanphilg at hotmail dot com
Summary: BCMath bcmul not round the last decimal
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Unix
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
> I already fixed this one (because of a user note).
With the test case given by jeanphilg I still get 47.161.
PHP 5.3.5 with Win7 x64
Previous Comments:
------------------------------------------------------------------------
[2006-09-06 10:34:13] nlopess@php.net
I already fixed this one (because of a user note).
------------------------------------------------------------------------
[2006-08-23 20:12:27] jeanphilg at hotmail dot com
Description:
------------
This example is totally false :
echo bcmul('1.34747474747', '35', 3); //47.162
If you use this line of code in your app, PHP will not round the last decimal. The value will be
truncated at the third position and... here's the result :
-------> 47.161 <-------
Please at least change the doc.
- JP
Reproduce code:
---------------
//Give 47.161, not 47.162
echo bcmul('1.34747474747', '35', 3);
Expected result:
----------------
47.162
Actual result:
--------------
47.161
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=38573&edit=1