Last active
December 1, 2017 11:54
-
-
Save nikhilvibhav/87f92185327721d422543e4adaf178b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
pi = 0 | |
fpi = float(pi) | |
pi_inv = 0 | |
fpi_inv = float(pi_inv) | |
# Ramanujam Formula# | |
for n in range(1, 10): | |
ram_formula = (math.factorial(4 * n) / ((4 ** n) * math.factorial(n)) ** 4) * ((1103 + 26390 * n) / (99 ** (4 * n))) | |
fpi_inv = fpi_inv + (math.sqrt(8) / (99 ** 2)) * ram_formula | |
print(fpi_inv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment