|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2008-11-13 12:46 UTC] 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' PatchesPull Requests
Pull requests: 
 HistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
Here is function that works correctly: function bcmod( $op, $mod, $scale ) { while( ($t = bcsub( $op, $mod, $scale )) > 0 ) $op = $t; return $op; }Correction, need ">= 0": function bcmod( $op, $mod, $scale ) { while( ($t = bcsub( $op, $mod, $scale )) >= 0 ) $op = $t; return $op; }