Class: Numeric

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

Instance Method Summary collapse

Instance Method Details

#even?Boolean

Returns:

  • (Boolean)


1694
1695
1696
# File 'lib/nio/fmt.rb', line 1694

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

#odd?Boolean

Returns:

  • (Boolean)


1699
1700
1701
# File 'lib/nio/fmt.rb', line 1699

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