Miller–Rabin primality test: Difference between revisions

m
→‎{{header|REXX}}: minor corrections
m (→‎{{header|REXX}}: minor corrections)
Line 2,170:
numeric digits max(200,2*limit) /*we're dealing with some biggies*/
tell=accur<0 /*show primes if K is negative.*/
accur=abs(accur) /*now, make K postivepositive. */
call suspenders /*suspenders now, belt later... */
primePi=# /*save the count of (real) primes*/
say "They'reThere are" primePi 'primes ≤' limit /*might as well crow a wee bit. */
say /*nothing wrong with whitespace. */
do a=2 to accur /*(skipping 1) do range of K's.*/
Line 2,213:
do r=1 for s-1
x=(x*x) // n
if x==1 then return 0 /*it's definatelydefinitely not prime. */
if x==nL then leave
end /*r*/
Line 2,237:
{{out|Output when using the input of: <tt>10000 10</tt>}}
<pre style="height:30ex;overflow:scroll">
They'reThere are 1229 primes ≤ 10000
 
───────────────────────────────────────────────────────────────────────────────
2,295

edits