Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / dromaeo / tests / sunspider-bitops-nsieve-bits.html
blob42e414cd15d69f9be3a0fa9c3e60b61f0a4f4792
1 <html>
2 <head>
3 <script src="../htmlrunner.js"></script>
4 <script>
5 // The Great Computer Language Shootout
6 // http://shootout.alioth.debian.org
7 //
8 // Contributed by Ian Osgood
10 function pad(n,width) {
11 var s = n.toString();
12 while (s.length < width) s = ' ' + s;
13 return s;
16 function primes(isPrime, n) {
17 var i, count = 0, m = 10000<<n, size = m+31>>5;
19 for (i=0; i<size; i++) isPrime[i] = 0xffffffff;
21 for (i=2; i<m; i++)
22 if (isPrime[i>>5] & 1<<(i&31)) {
23 for (var j=i+i; j<m; j+=i)
24 isPrime[j>>5] &= ~(1<<(j&31));
25 count++;
29 window.onload = function(){ startTest("sunspider-bitops-nsieve-bits", '35973a6b');
31 var i = 2;
33 test( "N-Sieve Bits", function(){
34 var isPrime = new Array((10000<<i)+31>>5);
35 primes(isPrime, i);
36 });
38 endTest(); };
39 </script>
40 </head>
41 <body></body>
42 </html>