I'm floundering on a question I'm trying to solve using Scheme. Fully understanding the homework policy on EE, I just need a bit of help in the right direction.
Trying to write a definition for the mathematical constant "e", to be solved using (1/0!)+(1/1!)+(1/2!)... up to some number I provide. I have the attached code, and I can't understand why it doesn't work.
(define (fact n) ;;method to solve a factorial
(if (= n 0)
(* n (fact (- n 1)))))
(define count 0) ;;keeps track of progress
(define total 0) ;;keeps running total
(define (e limit)
(if (< count limit)
(e (+ total (/ 1 (fact (+ count 1)))))