Пример #1
0
/**
 */
function bmod($p, $m)
{
    global $bdm;
    if (count($m) == 1) {
        if (count($p) == 1) {
            return array($p[0] % $m[0]);
        }
        if ($m[0] < $bdm) {
            return array(simplemod($p, $m[0]));
        }
    }
    $r = new bdiv($p, $m);
    return $r->mod;
}
Пример #2
0
/**
 * @param $p
 * @param $m
 * @return array
 */
function bmod($p, $m)
{
    global $bdm;
    if (count($m) == 1) {
        if (count($p) == 1) {
            return [$p[0] % $m[0]];
        }
        if ($m[0] < $bdm) {
            return [simplemod($p, $m[0])];
        }
    }
    $r = new BDiv($p, $m);
    return $r->mod;
}