1.PI圆周率的计算(公式:4*(1-1/3+1/5-1/7+1/9-1/11+1/13·······)4百W 次循环可以精确到小数点后6位)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script>
function test (){
var s = 1;
for(var i=3;i<4000000;i+=2){
if(i==3){
s-=1/i;
}else{
if((i-1)%4==0){
s+=(1/i);
//alert("+"+i)
}
if((i+1)%4==0){
s-=(1/i);
//alert("-"+i)
}
}
}
alert(4*s);
}
</script>
</head>
<body οnlοad="test()">
</body>
</html>
2.以后有空再补充