3 <script src=
"../htmlrunner.js"></script>
5 // The Great Computer Language Shootout
6 // http://shootout.alioth.debian.org/
8 // modified by Isaac Gouy
10 function pad(number
,width
){
11 var s
= number
.toString();
12 var prefixWidth
= width
- s
.length
;
14 for (var i
=1; i
<=prefixWidth
; i
++) s
= " " + s
;
19 function nsieve(m
, isPrime
){
22 for (i
=2; i
<=m
; i
++) { isPrime
[i
] = true; }
27 for (k
=i
+i
; k
<=m
; k
+=i
) isPrime
[k
] = false;
34 window
.onload = function(){ startTest("sunspider-access-nsieve", 'efeee6f3');
36 test( "N-Sieve", function(){
37 for ( var i
= 1; i
<= 2; i
++ ) {
39 var flags
= Array(m
+1);