Added some info about where I found the pi approximation

gol
Daniel Knüttel 2018-10-24 17:48:09 +02:00
parent 0376b823cf
commit 32f23dad4a
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,9 @@
import math
def bailey_borwein_plouffe_pi(n):
"""
See https://en.wikipedia.org/wiki/Approximations_of_%CF%80#Efficient_methods
"""
result = 0
for k in range(n):
result += (1/16)**k * ( 4/(8*k + 1) - 2/(8*k + 4) - 1/(8*k + 5) - 1/(8*k + 6))