Skip to content

Instantly share code, notes, and snippets.

@apeiros

apeiros/blurp.rb Secret

Created November 5, 2017 00:17
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
class Integer
def exp_of_base?(base)
num, mod = self, 0
num, mod = num.divmod(base) until num == 1 || mod > 0
mod == 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment