Leibniz formula for Pi. When it is solved for Pi one gets:
Where the variable "Pi" is the value of Pi, "i" is the number of times the loop is repeated, and "n" is just a variable to help in the formula. This I however found could further simplified to:
Of course the more times the loop is repeated, the more accurate your value of Pi gets, and while 1000 may seem like a large number, the value of Pi which it calculated is wrong after the 3rd decimal point. I've had it repeat over 100,000 times and it gets more accurate, however, remember that making the number of repeats can slow down and even crash your browse
π = 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 +4/13 -........
Ramanujan's formula for Pi