def calc(result) (1..).each { |i| break i if 2 ** i > result } end puts calc(5)