Top Level Namespace
Defined Under Namespace
Modules: Memoize Classes: Math2, MemCacheStore
Instance Method Summary collapse
Instance Method Details
#fib(n) ⇒ Object
258 259 260 261 |
# File 'lib/memoize.rb', line 258 def fib(n) return 1 if n < 2 fib(n-1) + fib(n-2) end |