Skip to content

Instantly share code, notes, and snippets.

@abdollar
Forked from peterc/fib.rb
Created December 21, 2011 06:11
Show Gist options
  • Save abdollar/1504861 to your computer and use it in GitHub Desktop.
Save abdollar/1504861 to your computer and use it in GitHub Desktop.
fib=->(n){_=5**0.5;(((1+_)**n-(1-_)**n)/(2**n*_)).to_i}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment