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

use std
 
const main = {
   var f: uint64 = 1
   var e: flt64 = 2.0
   var e0: flt64 = 0.0
   var n = 2
 
   while e > e0
      e0 = e
      f *= n
      e += 1.0 / (f : flt64)
      n++
   ;;
   std.put("e: {}\n", e)
}