Skip to content

Instantly share code, notes, and snippets.

@back-seat-driver
Created July 25, 2017 22:38
Show Gist options
  • Save back-seat-driver/77df8af45dbb5cec8cc604ebbff6a967 to your computer and use it in GitHub Desktop.
Save back-seat-driver/77df8af45dbb5cec8cc604ebbff6a967 to your computer and use it in GitHub Desktop.
Pi Convergence
i = 2
n_0 = 4
while True==True:
v_2 = (float(1)/float((i*4)-3))
v_3 = (float(1)/float((i*4)-5))
n_1 = float(n_0) + (4 * (v_2 - v_3))
n_0 = float(n_1)
i+=1
print(n_1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment