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

' version 02-07-2018
' compile with: fbc -s console
 
Dim As Double e , e1
Dim As ULongInt n = 1, n1 = 1
 
e = 1 / 1
 
While e <> e1
    e1 = e
    e += 1 / n
    n1 += 1
    n *= n1
Wend
 
Print "The value of e ="; e
 
' empty keyboard buffer
While InKey <> "" : Wend
Print : Print "hit any key to end program"
Sleep
End