ich habe vor kurzem einen Pi-Errechner geschrieben:
Code: Alles auswählen
import math
a=x=1
b = 1.0/math.sqrt(2.0)
c = 1.0/4.0
while True:
y = a
a = (a+b)/2.0
b = math.sqrt(b*y)
c = c - x * (a- y) ** 2.0
x = 2.0 * x
print (((a+b)**2.0)/(4.0*c))
Was könnte die Ursache sein?