|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78556 bcmul
Submitted: 2019-09-18 07:29 UTC Modified: 2019-09-18 07:32 UTC
From: shinzan69 at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: BC math related
PHP Version: 7.2.22 OS: CentOS Linux release 7.6.1810 (C
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 11 = ?
Subscribe to this entry?

 [2019-09-18 07:29 UTC] shinzan69 at gmail dot com
From manual page:

echo bcmul(10000000, 0.00001, 5);
=> 0

I expect "100". But return 0

Test script:
echo bcmul(10000000, 0.00001, 5);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-18 07:32 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-09-18 07:32 UTC]
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:

Use strings for BCMath functions, e.g. <>.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 24 22:03:39 2021 UTC