/** */ 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; }
/** * @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; }