Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fibonacci tail recursion in Scheme
(define (fib n)
(define (iter a b count)
(if (<= count 0)
a
(iter b (+ a b) (- count 1))))
(iter 0 1 n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.