Anonymous user
Miller–Rabin primality test: Difference between revisions
m
→{{header|PHP}}
(→{{header|Perl}}: added php) |
m (→{{header|PHP}}) |
||
Line 969:
$a = rand(2, $n-1);
$x =
if ($x == 1 || $x == $n-1)
continue;
for ($j = 1; $j < $s; $j++) {
$x = bcmod(bcmul($x, $x), $n);
if ($x == 1)
|