ChudnPi/chega_in_unix
ChudnPi/Chosen__1
f1import mathf1import math
2from decimal import *2from decimal import *
33
44
5def PiGen():5def PiGen():
6    getcontext().prec = 99996    getcontext().prec = 9999
n7    sum = Decimal('0')n7    ans = Decimal('0')
8    q = 08    k = 0
9    fst_num = 426880*Decimal.sqrt(Decimal('10005'))9    chislo1 = 426880*Decimal.sqrt(Decimal('10005'))
10    while True:10    while True:
t11        scd_num = math.factorial(6*q) * (13591409 + 545140134 * q)t11        chisl = math.factorial(6*k) * (13591409 + 545140134 * k)
12        scd_den = math.factorial(12        znam = math.factorial(3*k) * (math.factorial(k) ** 3) * \
13            3*q) * (math.factorial(q) ** 3) * (Decimal('-262537412640768000') ** q)13            (Decimal('-262537412640768000') ** k)
14        sum += scd_num/scd_den14        ans += chisl/znam
15        q += 115        k += 1
16        res = fst_num/sum16        res = chislo1/ans
17        yield res17        yield res
1818
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op