testsrc.benchmarks.sunspider-0.9.1.bitops-nsieve-bits.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rhino Show documentation
Show all versions of rhino Show documentation
A distribution of rhino which releases snapshots from a submodule folder containing forked sources.
The newest version!
// The Great Computer Language Shootout
// http://shootout.alioth.debian.org
//
// Contributed by Ian Osgood
function pad(n,width) {
var s = n.toString();
while (s.length < width) s = ' ' + s;
return s;
}
function primes(isPrime, n) {
var i, count = 0, m = 10000<>5;
for (i=0; i>5] & 1<<(i&31)) {
for (var j=i+i; j>5] &= ~(1<<(j&31));
count++;
}
}
function sieve() {
for (var i = 4; i <= 4; i++) {
var isPrime = new Array((10000<>5);
primes(isPrime, i);
}
}
sieve();