Bug #78556 [Opn->Nab]: bcmul

From: Date: Wed, 18 Sep 2019 07:32:52 +0000
Subject: Bug #78556 [Opn->Nab]: bcmul
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222799@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78556&edit=1 ID: 78556 Updated by: cmb@php.net Reported by: shinzan69 at gmail dot com Summary: bcmul -Status: Open +Status: Not a bug Type: Bug Package: BC math related Operating System: CentOS Linux release 7.6.1810 (C PHP Version: 7.2.22 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about "floats" and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Use strings for BCMath functions, e.g. <https://3v4l.org/2A2l3>. Previous Comments: ------------------------------------------------------------------------ [2019-09-18 07:29:31] shinzan69 at gmail dot com Description: ------------ --- From manual page: https://php.net/function.bcmul --- echo bcmul(10000000, 0.00001, 5); => 0 I expect "100". But return 0 Test script: --------------- echo bcmul(10000000, 0.00001, 5); Expected result: ---------------- 100 Actual result: -------------- 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78556&edit=1

« previous php.bugs (#222799) next »