Skip to content

Instantly share code, notes, and snippets.

@mindplace
Created March 29, 2016 14:54
Show Gist options
  • Select an option

  • Save mindplace/57fb6100245cfbdfd979 to your computer and use it in GitHub Desktop.

Select an option

Save mindplace/57fb6100245cfbdfd979 to your computer and use it in GitHub Desktop.
def is_fibonacci?(num)
fib_array = [0, 1, 1]
while fib_array.last < num
fib_array << fib_array[-1] + fib_array[-2]
end
fib_array.last == num
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment