Bug #46564 [Nab->Csd]: bcmod( '1071', '357.5' ) returns '0'
| From: | nikic@php.net | Date: | Sat, 07 Jan 2017 18:10:47 +0000 |
| Subject: | Bug #46564 [Nab->Csd]: bcmod( '1071', '357.5' ) returns '0' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206354@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=46564&edit=1
ID: 46564
Updated by: nikic@php.net
Reported by: shelby at coolpage dot com
Summary: bcmod( '1071', '357.5' ) returns '0'
-Status: Not a bug
+Status: Closed
Type: Bug
Package: BC math related
Operating System: *
PHP Version: 5.*, 6CVS (2009-04-01)
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of liborm85@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=90dcbbe3cb9aed197cbb854afe2eed0f6479a95a
Log: Fixed bug #46564
Previous Comments:
------------------------------------------------------------------------
[2011-11-16 14:22:22] shelby at coolpage dot com
Is it your position that the bug is in a 3rd party library that PHP uses for the
BC math API?
If yes, is it your position that marking a bug as bogus, is okay even while the
API performs erroneous to the documentation?
Thanks for providing yet another evidence that bug reporting is a waste of time.
------------------------------------------------------------------------
[2011-11-16 13:23:21] felipe@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Not a PHP bug.
------------------------------------------------------------------------
[2008-11-13 13:20:43] shelby at coolpage dot com
Correction, need ">= 0":
function bcmod( $op, $mod, $scale )
{
while( ($t = bcsub( $op, $mod, $scale )) >= 0 ) $op = $t;
return $op;
}
------------------------------------------------------------------------
[2008-11-13 13:03:27] support at coolpage dot com
Here is function that works correctly:
function bcmod( $op, $mod, $scale )
{
while( ($t = bcsub( $op, $mod, $scale )) > 0 ) $op = $t;
return $op;
}
------------------------------------------------------------------------
[2008-11-13 12:46:51] shelby at coolpage dot com
Description:
------------
bcmod( '1071', '357.5' ) returns '0'
Reproduce code:
---------------
echo bcmod( '1071', '357.5' );
Expected result:
----------------
bcmod( '1071', '357.5' ) should return '356'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=46564&edit=1