Skip to content

Instantly share code, notes, and snippets.

@citizen428
Created April 13, 2010 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save citizen428/365000 to your computer and use it in GitHub Desktop.
Save citizen428/365000 to your computer and use it in GitHub Desktop.
class Fixnum
alias_method :intdiv, :/
def /(divisor)
(self % divisor) == 0 ? self.intdiv(divisor) : self.to_f/divisor
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment