Module: Fibonacci
Instance Method Summary collapse
Instance Method Details
#closest_fibonacci ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/fibonacci-evs.rb', line 2 def closest_fibonacci p, n = 0, 1 until n >= self do p, n = n, (p + n) end p end |