#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sun, 26 May 2019 10:58:32 +0200
changeset 24154 a118b07ac9e2
parent 24153 88feac51cfbb
child 24155 d2c7144d7899
#FEATURE by cg class: Complex changed: #=
Complex.st
--- a/Complex.st	Sun May 26 10:58:01 2019 +0200
+++ b/Complex.st	Sun May 26 10:58:32 2019 +0200
@@ -596,11 +596,14 @@
     "
 !
 
-= aNumber
+= anObject
     "return true, if the argument represents the same numeric value
      as the receiver, false otherwise."
 
-    ^ aNumber equalFromComplex:self
+    anObject class == self class ifTrue:[
+        ^ (real = anObject real) and:[ (imaginary = anObject imaginary)]
+    ].
+    ^ anObject equalFromComplex:self
 
     "
      (Complex real:1.0 imaginary:2.0) = (Complex real:1.0 imaginary:2.0)
@@ -608,6 +611,7 @@
     "
 
     "Modified (comment): / 12-06-2017 / 20:43:41 / cg"
+    "Modified: / 26-05-2019 / 10:04:33 / Claus Gittinger"
 !
 
 hash