Created
December 14, 2011 18:11
-
-
Save pzgz/1477765 to your computer and use it in GitHub Desktop.
Fibonacci Bench Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fibonacci(n) | |
a,b = 0, 1 | |
n.times do | |
a,b = b,a+b | |
end | |
b | |
end | |
puts fibonacci(40) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment