Minimum primes: Difference between revisions
Content added Content deleted
m (→{{header|Ring}}: streamlined) |
m (→{{header|Ring}}: simplified nxtPrime()) |
||
Line 199: | Line 199: | ||
func nxtPrime(x) |
func nxtPrime(x) |
||
j = 2 |
|||
while |
while true |
||
if x % j = 0 j = 2 x++ |
if x % j = 0 j = 2 x++ |
||
else j++ ok |
else j++ ok |
||
if j * j > x |
if j * j > x exit ok |
||
end return string(x)</lang> |
end return string(x)</lang> |
||
{{out}} |
{{out}} |