rubyx/stash/fibo_times.ruby

15 lines
201 B
Plaintext
Raw Normal View History

def fibonaccit(n)
2015-11-06 13:24:57 +01:00
a = 0
b = 1
(n-1).times do
tmp = a
a = b
b = tmp + b
end
2015-11-06 13:24:57 +01:00
b
end
2015-11-06 13:24:57 +01:00
#1000000.times {fibonaccit( 30 )}
#10.times {|i| puts fibonaccit(i+90).class}
puts fibonaccit 90