Skip to content

Instantly share code, notes, and snippets.

@hyotang666
Created July 12, 2016 09:04
Show Gist options
  • Save hyotang666/b4385eaa724a4a527a9fdbbd8dbb4f9d to your computer and use it in GitHub Desktop.
Save hyotang666/b4385eaa724a4a527a9fdbbd8dbb4f9d to your computer and use it in GitHub Desktop.
(declaim(ftype(function((mod #.most-positive-fixnum))(mod #.most-positive-fixnum))fib))
(eval-when(:execute :load-toplevel :compile-toplevel)
(defun fib (n)
(declare(optimize (speed 3)(safety 0)))
(if (< n 2)
n
(+ (fib (- n 2))
(fib (- n 1)))))
)
(time(print #.(fib 38)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment