2 <!-- MOZ_INSERT_CONTENT_HOOK -->
3 <script src = runner.js
></script>
5 var onlyName
= 'Partial Sums', onlyNum
= 1024;
8 // The Computer Language Shootout
9 // http://shootout.alioth.debian.org/
10 // contributed by Isaac Gouy
13 var a1
= a2
= a3
= a4
= a5
= a6
= a7
= a8
= a9
= 0.0;
14 var twothirds
= 2.0/3.0;
16 var k2
= k3
= sk
= ck
= 0.0;
18 for (var k
= 1; k
<= n
; k
++){
25 a1
+= Math
.pow(twothirds
,k
-1);
26 a2
+= Math
.pow(k
,-0.5);
27 a3
+= 1.0/(k
*(k
+1.0));
28 a4
+= 1.0/(k3
* sk
*sk
);
29 a5
+= 1.0/(k3
* ck
*ck
);
37 startTest("real-partial-sums");
39 for ( var i
= 1024; i
<= 8192; i
*= 2 ) (function(i
){
40 test( "Partial Sums", i
, function(){
48 <body onload=
"thisTest()"></body></html>