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

$define EPSILON 1.0e-15
 
procedure main()
   local e0
   local e := 2.0
   local fact := 1
   local n := 2
 
   repeat {
      e0 := e
      fact *:= n
      n +:= 1
      e +:= (1.0 / fact)
      if abs(e - e0) < EPSILON then break
   }
   write("computed e ", e)
   write("keyword &e ", &e)
end