<?php
string bcmod ( string $num1,
string $num2,
?int $scale = null )
where,
$num1 = The dividend as STRING
$num2 = The divisor as STRING
$scale = The number of decimal places considered by this operation
?>
<?php
$s01a = 4;
$v01a = 88.9986;
$v01b = 52.132;
$bc01 = bcmod($v01a, $v01b, $s01a );
echo 'The division:<br><br>( ' . $v01a . ' / ' . $v01b . ' ) =<br><br>= bcmod( ' . $v01a . ', ' . $v01b . ', ' . $s01a . ' )<br><br>remainder = ' . $bc01 .' [ scale( ' . $s01a . ' )]<br><br><br>';
$fm01 = fmod($v01a, $v01b);
echo 'The same as:<br><br>fmod( ' . $v01a . ', ' . $v01b . ' ) = ' . $fm01 . '<br><br><br>';
$nd01 = intdiv($v01a, $v01b);
echo 'This leads us to:<br><br>intdiv( ' . $v01a . ', ' . $v01b . ' ) = ' . $nd01 .'<br><br>where:<br><br>';
$cp01 = ($v01b * $nd01) + $bc01;
echo $cp01 . ' = (' . $v01a . ' * ' . $nd01 . ') + ' . $bc01 ;
?>