From 32f23dad4af277bcba608884a2d77a0e1bbada9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 24 Oct 2018 17:48:09 +0200 Subject: [PATCH] Added some info about where I found the pi approximation --- ex_01_03.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ex_01_03.py b/ex_01_03.py index d0e1b46..2c56197 100644 --- a/ex_01_03.py +++ b/ex_01_03.py @@ -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))