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

From: Date: Wed, 06 Sep 2006 10:34:14 +0000
Subject: #38573 [Opn->Csd]: BCMath bcmul not round the last decimal
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373926@lists.php.net to get a copy of this message
ID: 38573 Updated by: nlopess@php.net Reported By: jeanphilg at hotmail dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Unix PHP Version: Irrelevant New Comment: I already fixed this one (because of a user note). Previous Comments: ------------------------------------------------------------------------ [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/?id=38573&edit=1

« previous php.doc (#969373926) next »