Number
type Integer
Implements Monoid, Group, Blankable, Truthyable.
even?
even? : Bool
Returns true if the integer is even.
Examples
4.even? # => true
3.even? # => false
modulo
modulo(n: Integer) -> Integer
Returns this modulo n. The result has the same sign as n, consistent with mathematical modulo (not C remainder).
Parameters
n
Examples
7.modulo(3) # => 1
(-7).modulo(3) # => 2
in?
in?(range: Range<Integer>) -> Bool
Returns true if the integer falls within range (inclusive).
Parameters
range
Examples
5.in?(1..10) # => true
11.in?(1..10) # => false
From Monoid
repeat- Combines this value with itself
ntimes.
Defined in other modules
type Float
Implements Blankable, Truthyable.