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

mode divMaxScale = 104
 
val .epsilon = 1.0e-104
 
var .e = 2
 
for .fact, .n = 1, 2 ; ; .n += 1 {
    val .e0 = .e
    .fact x= .n
    .e += 1 / .fact
    if abs(.e - .e0) < .epsilon: break
}
 
writeln ".e = ", .e
 
# compare to built-in constant e
writeln " e = ", e