Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/nio/fmt.rb

Instance Method Summary collapse

Instance Method Details

#even?Boolean

Returns:

  • (Boolean)


1660
1661
1662
# File 'lib/nio/fmt.rb', line 1660

def even?
  self.modulo(2)==0
end

#odd?Boolean

Returns:

  • (Boolean)


1665
1666
1667
# File 'lib/nio/fmt.rb', line 1665

def odd?
  self.modulo(2)!=0
end