I\'m trying to implement the following function, but it keeps giving me the stack level too deep (SystemStackError) error.
stack level too deep (SystemStackError)
Any ideas what the problem mi
This may help you.
def fib_upto(max) i1, i2 = 1, 1 while i1 <= max yield i1 i1, i2 = i2, i1+i2 end end fib_upto(5) {|f| print f, " "}