Returns true if this integer is even, false otherwise.
14.even? # -> true 15.even? # -> false
[Source]
# File lib/extensions/numeric.rb, line 20 def even? self % 2 == 0 end
Returns true if this integer is odd, false otherwise.
-99.odd? # -> true -98.odd? # -> false
# File lib/extensions/numeric.rb, line 37 def odd? self % 2 == 1 end
[Validate]