handle shortFloat case in Float =
authorClaus Gittinger <cg@exept.de>
Thu, 09 Jul 1998 10:07:24 +0200
changeset 3632 5b73e23c0beb
parent 3631 26a44b284912
child 3633 89f1f31527f4
handle shortFloat case in Float =
Float.st
--- a/Float.st	Thu Jul 09 10:06:37 1998 +0200
+++ b/Float.st	Thu Jul 09 10:07:24 1998 +0200
@@ -801,14 +801,17 @@
 %{  /* NOCONTEXT */
 
     if (aNumber != nil) {
-	if (__isSmallInteger(aNumber)) {
-	    RETURN ( (__floatVal(self) == (double)(__intVal(aNumber))) ? true : false );
-	}
-	if (__qIsFloatLike(aNumber)) {
-	    RETURN ( (__floatVal(self) == __floatVal(aNumber)) ? true : false );
-	}
+        if (__isSmallInteger(aNumber)) {
+            RETURN ( (__floatVal(self) == (double)(__intVal(aNumber))) ? true : false );
+        }
+        if (__qIsFloatLike(aNumber)) {
+            RETURN ( (__floatVal(self) == __floatVal(aNumber)) ? true : false );
+        }
+        if (__qClass(aNumber)==ShortFloat) {
+            RETURN ( (__floatVal(self) == (double)(__shortFloatVal(aNumber))) ? true : false );
+        }
     } else {
-	RETURN (false);
+        RETURN (false);
     }
 %}.
     ^ self retry:#= coercing:aNumber
@@ -1782,6 +1785,6 @@
 !Float class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.84 1998-06-09 11:32:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.85 1998-07-09 08:07:24 cg Exp $'
 ! !
 Float initialize!