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

  $ "bigrat.qky" loadfile
 
  [ swap number$ 
    tuck size - 
    times sp echo$ ] is echo-rj ( n n --> )
 
  [ 2dup swap 
    say "  First " echo 
    say " approximations of e by sum of 1/n! displayed to "
    echo say " decimal places." cr
    cr
    temp put
    1 n->v rot
    1 swap times 
      [ i^ 1+ * 
        dup n->v 1/v
        rot dip
          [ v+ 2dup
            i^ 1+ 5 echo-rj
            say " : "
            temp share point$ echo$
            cr ] ] 
     3 times drop temp release ]    is approximate-e ( n n --> )
 
  55 70 approximate-e