Edit report at https://bugs.php.net/bug.php?id=46564&edit=1
ID: 46564 Updated by: [email protected] Reported by: shelby at coolpage dot com Summary: bcmod( '1071', '357.5' ) returns '0' -Status: Verified +Status: Bogus Type: Bug Package: BC math related Operating System: * PHP Version: 5.*, 6CVS (2009-04-01) Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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
