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

#lang racket
(require math/number-theory)
 
(define (calculate-e (terms 20))
  (apply + (map (compose / factorial) (range terms))))
 
(module+ main
  (let ((e (calculate-e)))
    (displayln e)
    (displayln (real->decimal-string e 20))
    (displayln (real->decimal-string (- (exp 1) e) 20))))