1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

get rid of ambiguous parentheses warnings

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-11-29 16:06:54 +00:00
parent db31f2fafb
commit 716610ae56
12 changed files with 33 additions and 33 deletions

View file

@ -214,10 +214,10 @@ class SimpleRat < Numeric
def numerator() @num end
def denominator() @den end
def +@ () self end
def -@ () self.class.new(-@num, @den) end
def +@() self end
def -@() self.class.new(-@num, @den) end
def + (o)
def +(o)
case o
when SimpleRat, Rational
a = @num * o.denominator
@ -233,7 +233,7 @@ class SimpleRat < Numeric
end
end
def - (o)
def -(o)
case o
when SimpleRat, Rational
a = @num * o.denominator
@ -249,7 +249,7 @@ class SimpleRat < Numeric
end
end
def * (o)
def *(o)
case o
when SimpleRat, Rational
a = @num * o.numerator
@ -334,7 +334,7 @@ class SimpleRat < Numeric
def divmod(o) [div(o), modulo(o)] end
def quotrem(o) [quot(o), remainder(o)] end
def ** (o)
def **(o)
case o
when SimpleRat, Rational
Float(self) ** o
@ -357,7 +357,7 @@ class SimpleRat < Numeric
end
end
def <=> (o)
def <=>(o)
case o
when SimpleRat, Rational
a = @num * o.denominator
@ -373,7 +373,7 @@ class SimpleRat < Numeric
end
end
def == (o)
def ==(o)
begin
(self <=> o) == 0
rescue