Numeric
is the abstract class for the numbers.
Object
Comparable
+ self
Returns self
.
- self
Returns negation of self
.
self <=> other
Returns -1, 0, or 1 depending on whether the left argument is numerically less than, equal to, or greater than the right argument.
abs
Returns absolute value of self
.
chr
Returns the string that contains the character represented
by that Integer(self)
in the ASCII character set.
For example, 65.chr
is "A"
.
coerce(number)
Converts self
and the number into
mutually calculatable numbers.
divmod(other)
Returns a pair of the quotient and remainder by other.
downto(min) {...}
Iterates from self
to min,
decrementing by 1.
integer?
Returns true if the receiver is integer.
step(max, step) {...}
Iterates from self
to max,
adding step each time.
times {...}
Iterates self
times. Self
may be
rounded into integer.
to_f
Converts self
into a floating-point number.
to_i
Returns an integer converted from self
.
upto(max) {...}
Iterates from self
to max,
incrementing by 1.