3 ms·
Bug: def pi(): ... while Ak != 0 : ... result = ... return result The two lines ‘result =’ and ‘return result’ are indented too fa
by Someone 5y ago
Bug:
def pi():
...
while Ak != 0 :
...
result = ...
return result
The two lines ‘result =’ and ‘return result’ are indented too far.
Verified by replacing the last line by
print(stringPi[n-5:n+5])
and comparing the output given 1000 with https://decimal.info/digits-of-pi/value-of-pi-to-1000-decimal-places.html https://decimal.info/digits-of-pi/value-of-pi-to-1000-decima...
The bug starts to show different digits after
3.141592653589793238462643383
continuing with 58735 (should be 27950, according to https://www.piday.org/million/ https://www.piday.org/million/)