Anonymous user
Miller–Rabin primality test: Difference between revisions
→{{header|REXX}}: added more whitespace, simplified some statements.
m (→{{header|REXX}}: added/changed whitespace and comments, change indentations in program and output, simplified the genPrimes subroutine..) |
(→{{header|REXX}}: added more whitespace, simplified some statements.) |
||
Line 2,906:
if accur=='' | accur==',' then accur= 10 /* " " " " " " */
numeric digits max(200, 2*limit) /*we're dealing with some ginormous #s.*/
tell= accur<0; pad=left('',
accur=abs(accur);
call genPrimes limit /*suspenders now, use a belt later ··· */
say "There are"
say /*nothing wrong with some whitespace. */
do a=2 to accur /*(skipping unity) do range of K's. */
Line 2,919:
if p==0 then iterate /*Not prime? Then try another number.*/
mrp=mrp+1 /*well, found another one, by gum! */
if tell then say z 'is prime according to' @MRpt "with K="a
if !.z then iterate
say '[K='a"] " z "isn't prime !" /*oopsy─doopsy and/or whoopsy─daisy !*/
end /*z*/
say pad 'for 1──►'limit", K="right(a,w)',' @MRpt "found"
end /*a*/
exit /*stick a fork in it, we're all done. */
|