All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rhino1.7.7.testsrc.benchmarks.sunspider-0.9.1.bitops-nsieve-bits.js Maven / Gradle / Ivy

Go to download

Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.

There is a newer version: 1.7.15
Show 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();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy