summaryrefslogtreecommitdiff
path: root/lib/complex.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-06 09:49:12 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-06 09:49:12 +0000
commit117b4df7c78ccb9437e2f14ecd2cd6f51cb757f3 (patch)
treeef293f2979213ad5d6c066ba6a32d2a385a74514 /lib/complex.rb
parent9a4c66277185ea3239f05704c881c72520a6da90 (diff)
* lib/complex.rb (Complex#==): should not raise error by type
mismatch. * lib/rational.rb (Rational#==): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/complex.rb')
-rw-r--r--lib/complex.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/complex.rb b/lib/complex.rb
index ccf357c..98af310 100644
--- a/lib/complex.rb
+++ b/lib/complex.rb
@@ -265,8 +265,7 @@ class Complex < Numeric
elsif Complex.generic?(other)
@real == other and @image == 0
else
- x , y = other.coerce(self)
- x == y
+ other == self
end
end