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

real N, E, E0, F;       \index, Euler numbers, factorial
[Format(1, 16);         \show 16 places after decimal point
N:= 1.0;  E:= 1.0;  F:= 1.0;
loop    [E0:= E;
        E:= E + 1.0/F;
        if E = E0 then quit;
        N:= N + 1.0;
        F:= F*N;
        ];
RlOut(0, E);  CrLf(0);
IntOut(0, fix(N));  Text(0, " iterations");
]