3 <script src=
"../htmlrunner.js"></script>
5 // The Computer Language Shootout
6 // http://shootout.alioth.debian.org/
7 // contributed by Isaac Gouy
10 var a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= a9
= 0.0;
11 var twothirds
= 2.0/3.0;
13 var k2
= k3
= sk
= ck
= 0.0;
15 for (var k
= 1; k
<= n
; k
++){
22 a1
+= Math
.pow(twothirds
,k
-1);
23 a2
+= Math
.pow(k
,-0.5);
24 a3
+= 1.0/(k
*(k
+1.0));
25 a4
+= 1.0/(k3
* sk
*sk
);
26 a5
+= 1.0/(k3
* ck
*ck
);
34 window
.onload = function(){ startTest("sunspider-math-partial-sums", 'a31c1c44');
36 test( "Partial Sums", function(){