Commit cb870de2 authored by go.kikuta's avatar go.kikuta

numeric.rb: refactor code (Avoid using {...} for multi-line blocks, ...

numeric.rb: refactor code (Avoid using {...} for multi-line blocks,  Surrounding space missing in default value assignment)
parent cf588bd5
......@@ -100,7 +100,7 @@ module Integral
# Calls the given block from +self+ to +num+
# incremented by +step+ (default 1).
#
def step(num, step=1, &block)
def step(num, step = 1, &block)
raise ArgumentError, "step can't be 0" if step == 0
return to_enum(:step, num, step) unless block_given?
......@@ -165,16 +165,12 @@ class Float
# floats should be compatible to integers.
def >> other
n = self.to_i
other.to_i.times {
n /= 2
}
other.to_i.times { n /= 2 }
n
end
def << other
n = self.to_i
other.to_i.times {
n *= 2
}
other.to_i.times { n *= 2 }
n.to_i
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment