Advertisement
Pietu1998

Chudnovsky

Jan 12th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. from math import*
  2. from decimal import*
  3. f,D=factorial,Decimal
  4. pi=lambda i:exec("getcontext().prec+=i*9")or 1/(sum((D(-1+k%2*2)*D(f(k*6))*(k*545140134+13591409))/(D(f(k*3))*D(f(k))**3*D("640320")**(k*3+1.5))for k in range(i))*-12)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement