summaryrefslogtreecommitdiffstats
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
commit5dc8d0d0300ca76e553fc8761ce20118359d48b6 (patch)
treeef293f2979213ad5d6c066ba6a32d2a385a74514 /lib/complex.rb
parent2bd0182b7894b360ed226cbc65886b855f10d788 (diff)
downloadruby-5dc8d0d0300ca76e553fc8761ce20118359d48b6.tar.gz
ruby-5dc8d0d0300ca76e553fc8761ce20118359d48b6.tar.xz
ruby-5dc8d0d0300ca76e553fc8761ce20118359d48b6.zip
* lib/complex.rb (Complex#==): should not raise error by type
mismatch. * lib/rational.rb (Rational#==): ditto. git-svn-id: http://svn.ruby-lang.org/repos/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 ccf357c7a..98af310d3 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