Module: Fibonacci

Included in:
Bignum, Fixnum
Defined in:
lib/fibonacci-evs.rb

Instance Method Summary collapse

Instance Method Details

#closest_fibonacciObject



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