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