Skip to content

Instantly share code, notes, and snippets.

@timm
Last active December 11, 2015 01:19
Show Gist options
  • Save timm/4522343 to your computer and use it in GitHub Desktop.
Save timm/4522343 to your computer and use it in GitHub Desktop.
iterative fib
(defun fib (n &aux (a 0) (b 1) tmp)
(dotimes (i n a)
(setf tmp a
a b
b (+ tmp b))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment