Created
May 30, 2023 10:14
-
-
Save Vuong-Chu/f7fa71140daedc45a0b008e7fac7745d 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 | |
def Wallis_Pi(n): | |
''' | |
Compute the decimals of Pi using the Wallis formula: | |
''' | |
return 2*math.prod([4*i**2 / (4*i**2 - 1) for i in range(1, n + 1)]) | |
Wallis_Pi(100_000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment