8 # Returns the receiver simply.
16 # Returns the receiver's value, negated.
24 # Returns the absolute value of the receiver.
39 # mruby special - module to share methods between Floats and Integers
40 # to make them compatible
43 # Calls the given block once for each Integer
44 # from +self+ downto +num+.
47 def downto(num, &block)
48 return to_enum(:downto, num) unless block
69 # Calls the given block +self+ times.
73 return to_enum :times unless block
84 # Calls the given block once for each Integer
85 # from +self+ upto +num+.
89 return to_enum(:upto, num) unless block
100 # Calls the given block from +self+ to +num+
101 # incremented by +step+ (default 1).
103 def step(num=nil, step=1, &block)
104 raise ArgumentError, "step can't be 0" if step == 0
105 return to_enum(:step, num, step) unless block
107 i = __coerce_step_counter(num, step)
108 if num == self || step.infinite?
109 block.call(i) if step > 0 && i <= (num||i) || step < 0 && i >= (num||-i)
137 # Returns the receiver simply.
145 # Returns the receiver simply.
153 # Returns the receiver simply.
159 # Returns the receiver simply.