Miller–Rabin primality test: Difference between revisions

m
(→‎{{header|Perl}}: added php)
Line 969:
$a = rand(2, $n-1);
 
$x = bcmodpowbcpowmod($a, $d, $n);
if ($x == 1 || $x == $n-1)
continue;
 
for ($j = 1; $j < $s; $j++) {
$x = bcmod(bcmul($x, $x), $n);
if ($x == 1)
Anonymous user