2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js
></script>
5 var onlyName
= 'N-Sieve', onlyNum
= 2;
8 // The Great Computer Language Shootout
9 // http://shootout.alioth.debian.org/
11 // modified by Isaac Gouy
13 function pad(number
,width
){
14 var s
= number
.toString();
15 var prefixWidth
= width
- s
.length
;
17 for (var i
=1; i
<=prefixWidth
; i
++) s
= " " + s
;
22 function nsieve(m
, isPrime
){
25 for (i
=2; i
<=m
; i
++) { isPrime
[i
] = true; }
30 for (k
=i
+i
; k
<=m
; k
+=i
) isPrime
[k
] = false;
37 startTest("real-nsieve");
39 for ( var i
= 1; i
<= 4; i
++ ) (function(i
){
40 test( "N-Sieve", i
, function(){
42 var flags
= Array(m
+1);
50 <body onload=
"thisTest()"></body></html>