MCPcopy Create free account
hub / github.com/apache/groovy / nsieve

Method nsieve

benchmark/bench/nsieve.java:9–21  ·  view source on GitHub ↗
(int m, boolean[] isPrime)

Source from the content-addressed store, hash-verified

7public class nsieve
8{
9 static int nsieve(int m, boolean[] isPrime)
10 {
11 for (int i=2; i <= m; i++) isPrime[i] = true;
12 int count = 0;
13
14 for (int i=2; i <= m; i++) {
15 if (isPrime[i]) {
16 for (int k=i+i; k <= m; k+=i) isPrime[k] = false;
17 count++;
18 }
19 }
20 return count;
21 }
22
23 public static String padNumber(int number, int fieldLen)
24 {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected