MCPcopy Index your code
hub / github.com/apache/groovy / nsieve

Method nsieve

benchmark/bench/nsievebits.java:11–23  ·  view source on GitHub ↗
(int m, BitSet bits)

Source from the content-addressed store, hash-verified

9public class nsievebits
10{
11 private static int nsieve(int m, BitSet bits) {
12 bits.set(0, m+1);
13
14 int count = 0;
15 for (int i = 2; i <= m; ++i) {
16 if (bits.get(i)) {
17 for (int j = i + i; j <=m; j += i)
18 bits.clear(j);
19 ++count;
20 }
21 }
22 return count;
23 }
24
25 public static String padNumber(int number, int fieldLen)
26 {

Callers 1

mainMethod · 0.95

Calls 3

getMethod · 0.65
clearMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected