*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 07 Jul 2000 11:35:35 +0200
changeset 5447 1e3d8ac264c7
parent 5446 e5ecc71d3054
child 5448 52bc958599a7
*** empty log message ***
SmallInteger.st
--- a/SmallInteger.st	Wed Jul 05 18:49:54 2000 +0200
+++ b/SmallInteger.st	Fri Jul 07 11:35:35 2000 +0200
@@ -2706,6 +2706,20 @@
 
 !SmallInteger methodsFor:'modulo arithmetic'!
 
+asUnsigned
+    "return an integer with my bit-pattern, but positive.
+     May be required for bit operations on the sign-bit."
+
+    self < 0 ifTrue:[
+        ^ self + (SmallInteger maxVal + 1) + (SmallInteger maxVal + 1)
+    ]
+
+    "
+     -1 asUnsigned          
+     SmallInteger minVal asUnsigned   
+    "
+!
+
 plus:aNumber
     "return the sum of the receiver and the argument, as SmallInteger.
      The argument must be another SmallInteger.
@@ -3174,5 +3188,5 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.129 2000-06-23 19:08:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.130 2000-07-07 09:35:35 cg Exp $'
 ! !