better abs & negated
authorClaus Gittinger <cg@exept.de>
Fri, 08 May 1998 15:06:46 +0200
changeset 3430 e42beefa71e7
parent 3429 50c2ce8d5a5f
child 3431 ae8f96921fcc
better abs & negated
SmallInt.st
SmallInteger.st
--- a/SmallInt.st	Fri May 08 14:15:34 1998 +0200
+++ b/SmallInt.st	Fri May 08 15:06:46 1998 +0200
@@ -581,9 +581,11 @@
     if (val != _MIN_INT) {
 	RETURN ( __MKSMALLINT(-val) );
     }
+    /* only reached for minVal */
+    RETURN( __MKLARGEINT(-_MIN_INT));
 %}.
-    "only reached for minVal"
-    ^ self negated
+"/    "only reached for minVal"
+"/    ^ self negated
 !
 
 negated
@@ -597,9 +599,11 @@
     if (val != _MIN_INT) {
 	RETURN ( __MKSMALLINT(- val) );
     }
+    /* only reached for minVal */
+    RETURN (__MKLARGEINT( -_MIN_INT));
 %}.
-    "only reached for minVal"
-    ^ (LargeInteger value:(SmallInteger maxVal)) + 1
+"/    "only reached for minVal"
+"/    ^ (LargeInteger value:(SmallInteger maxVal)) + 1
 !
 
 quo:aNumber
@@ -2649,5 +2653,5 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/SmallInt.st,v 1.93 1998-01-20 18:04:51 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/SmallInt.st,v 1.94 1998-05-08 13:06:46 cg Exp $'
 ! !
--- a/SmallInteger.st	Fri May 08 14:15:34 1998 +0200
+++ b/SmallInteger.st	Fri May 08 15:06:46 1998 +0200
@@ -581,9 +581,11 @@
     if (val != _MIN_INT) {
 	RETURN ( __MKSMALLINT(-val) );
     }
+    /* only reached for minVal */
+    RETURN( __MKLARGEINT(-_MIN_INT));
 %}.
-    "only reached for minVal"
-    ^ self negated
+"/    "only reached for minVal"
+"/    ^ self negated
 !
 
 negated
@@ -597,9 +599,11 @@
     if (val != _MIN_INT) {
 	RETURN ( __MKSMALLINT(- val) );
     }
+    /* only reached for minVal */
+    RETURN (__MKLARGEINT( -_MIN_INT));
 %}.
-    "only reached for minVal"
-    ^ (LargeInteger value:(SmallInteger maxVal)) + 1
+"/    "only reached for minVal"
+"/    ^ (LargeInteger value:(SmallInteger maxVal)) + 1
 !
 
 quo:aNumber
@@ -2649,5 +2653,5 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.93 1998-01-20 18:04:51 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.94 1998-05-08 13:06:46 cg Exp $'
 ! !