Skip to content

Instantly share code, notes, and snippets.

@AndrewGuard
Last active January 3, 2016 07:09
Show Gist options
  • Save AndrewGuard/8427450 to your computer and use it in GitHub Desktop.
Save AndrewGuard/8427450 to your computer and use it in GitHub Desktop.
def is_fib(num)
x = 0
y = 1
until y > num
x, y = y, x + y
end
x == num
end
p is_fib(8670007398507948658051921) #true
p is_fib(927372692193078999171) #false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment