Created
September 1, 2017 18:48
-
-
Save dphov/41a6884970bcc11dfa3fed5303deb7f6 to your computer and use it in GitHub Desktop.
factorial created by dphov - https://repl.it/Kctn/0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (fact-iter x counter n) | |
(if (> counter n) | |
x | |
(fact-iter (* x counter) (+ counter 1) n))) | |
(define (fact n) | |
(fact-iter 1 1 n) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment