Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/modcloth.rb

Instance Method Summary collapse

Instance Method Details

#closest_fibonacciObject



2
3
4
5
6
7
8
# File 'lib/modcloth.rb', line 2

def closest_fibonacci
  a,b = 0,1
  self.times do
    return a if b > self
    a,b = b,a+b
  end
end