|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69349 Default value of $scale parameter wrong
Submitted: 2015-04-01 17:38 UTC Modified: 2015-12-20 00:03 UTC
From: Assigned: tpunt (profile)
Status: Closed Package: BC math related
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2015-04-01 17:38 UTC]
From manual page:
Part of the function signature is:

  [, int $scale = int ]
That doesn't make much sense. The default is 0 or whatever has been
set with bcscale().


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-01 17:44 UTC]
bccomp(), bcmul(), bcpowmod() and bcsub() have the same issue.

Furthermore some of the BC Math functions specify:

  string $left_operand = "" , string $right_operand = ""
It doesn't seem to make much sense to give a default for a
mandatory parameter.
 [2015-04-01 19:37 UTC]
Automatic comment from SVN on behalf of sobak
Log: Mandatory parameters don't have default values

(partially fixes #69349)
 [2015-12-20 00:00 UTC]
-Assigned To: +Assigned To: tpunt
 [2015-12-20 00:00 UTC]
Automatic comment from SVN on behalf of tpunt
Log: Resolve doc bug #69349
 [2015-12-20 00:03 UTC]
I've resolved this with commit:

It sets the default parameter for scale to 0 for the mentioned functions and updates the scale parameter description (&bc.scale.description;) to say that it firstly defaults to the value set by bcscale(), and then falls back to 0 if that isn't set.
 [2015-12-20 00:03 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 19:01:32 2024 UTC