Doc #38573 [Csd->Asn]: BCMath bcmul not round the last decimal

From: Date: Fri, 03 Jun 2011 15:29:17 +0000
Subject: Doc #38573 [Csd->Asn]: BCMath bcmul not round the last decimal
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6685@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 User updated by: jeanphilg at hotmail dot com Reported by: jeanphilg at hotmail dot com Summary: BCMath bcmul not round the last decimal -Status: Closed +Status: Assigned Type: Documentation Problem Package: Documentation problem Operating System: Unix PHP Version: Irrelevant Block user comment: N Private report: N New Comment: robert, you're absolutely right. nlopess, 5 years and this bug is still not corrected. Please take time to check my testcase correctly before replying that's all is OK ! Thanks, - JP 2011 Previous Comments: ------------------------------------------------------------------------ [2011-06-03 13:47:06] robert at idacmedia dot com > 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 ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#6685) next »