Skip to content

Instantly share code, notes, and snippets.

@tafsiri
Created January 2, 2011 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tafsiri/762291 to your computer and use it in GitHub Desktop.
Save tafsiri/762291 to your computer and use it in GitHub Desktop.
#traditional recursive fib
fib := method(num,
if(num == 0 or num == 1
, num
, fib(num-1) + fib(num-2)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment