How to computes 60 digits of PI in Python

1 Answer

0 votes
from mpmath import mp

mp.dps = 60
print(mp.quad(lambda x: mp.exp(-x**2), [-mp.inf, mp.inf])**2)




'''
run:

3.14159265358979323846264338327950288419716939937510582097494

'''

 



answered Jan 31, 2020 by avibootz

Related questions

3 answers 171 views
171 views asked Jan 26, 2023 by avibootz
1 answer 164 views
1 answer 197 views
1 answer 127 views
...