Microsoft Small Basic

Program Listing: RMF924
' Calculate Napier's constant (the base of the natural logarithm)
' Version C
' Copyright © 2015 Nonki Takahashi. The MIT License.
' Last update 2015-07-16
' e = lim(n→∞) (1 + 1 / n) ^ n
n = 1
k = 16
While "True"
TextWindow.Write("n=" + n)
TextWindow.Write(" 1+1/n=" + (1 + 1 / n))
e = Math.Power(1 + 1 / n, n)
TextWindow.WriteLine(" e=" + e)
n = n * k
EndWhile