Task

Calculate the value of   e.



(e   is also known as   Euler's number   and   Napier's constant.)



See details: Calculating the value of e

with javascript_semantics 
atom e0 = 0, e = 2, n = 0, fact = 1
while abs(e-e0)>=1e-15 do
    e0 = e
    n += 1
    fact *= 2*n*(2*n+1)
    e += (2*n+2)/fact
end while
printf(1,"Computed e = %.15f\n",e)
printf(1,"    Real e = %.15f\n",E)
printf(1,"     Error = %g\n",E-e)
printf(1,"Number of iterations = %d\n",n)
