Just finished calculating pi to 30 trillion places.
#12
Kernelpanic
Ramanujan’s Formula for Pi would go something like this, consider it pseudo-code
Code: (Select All)
pie=0
digits=16 'number digits
m=digits/8 'number of terms

for n=0 to m
    tmp=factorial(n)
    tmp=factorial(4*n)/(tmp*tmp*tmp*tmp) 'tmp^4
    pie=pie+tmp*(26390*n+1103)/(396^(4*n))
next
pie=pie*sqr(8)/9801
pie=1/pie
print pie

function factorial(n)
    f=1
    if n=0 then
        factorial=f
        exit function
    end if
    for i=1 to n
        f=f*i
    next
    factorial=f
end function
Reply


Messages In This Thread
RE: Just finished calculating pi to 30 trillion places. - by Jack - 08-15-2022, 10:23 PM



Users browsing this thread: 7 Guest(s)