Sieve of Eratosthenes: Difference between revisions
Content added Content deleted
PatGarrett (talk | contribs) m (→{{header|Microsoft Small Basic}}: a correction) |
|||
Line 6,286: | Line 6,286: | ||
For n = 2 To math.SquareRoot(limit) |
For n = 2 To math.SquareRoot(limit) |
||
If flags[n] = 0 Then |
If flags[n] = 0 Then |
||
For K = n * n To limit Step |
For K = n * n To limit Step n |
||
flags[K] = 1 |
flags[K] = 1 |
||
EndFor |
EndFor |