<script> var MyPi = 1; for(var i = 0; i <= 999999999; i++) { i++; if((i % 4) == 1){MyPi -= 1/i}; if((i % 4) == 3){MyPi += 1/i}; } alert(MyPi * 4); </script>
alert(Math.PI);