<?php
GMP gmp_mod ( GMP|int|string $num1, GMP|int|string $num1um2 )
where,
$num1 = The divisor
$num1um2 = The dividend, the modulo that is being evaluated
?>
<?php
// Run this code several times
$n01 = mt_rand(-1, 7);
$d01 = mt_rand(-3, -2);
// You must test other values
$nd01 = gmp_mod($n01, $d01);
echo 'gmp_mod( ' . $n01 . ', '. $d01 . ' ) = ' .
gmp_strval($nd01) . '<br><br>';
echo 'This is sometimes equal to ( ' . abs($n01) . ' % '.
abs($d01) . ' ) = ' . abs($n01)%abs($d01) . '<br>';
?>