class: SmallInteger
authorClaus Gittinger <cg@exept.de>
Tue, 25 Jun 2013 22:37:31 +0200
changeset 15432 53d85559eaf1
parent 15431 096bf5b1b086
child 15433 426f079817b4
class: SmallInteger changed: #between:and:
SmallInteger.st
--- a/SmallInteger.st	Tue Jun 25 19:41:14 2013 +0200
+++ b/SmallInteger.st	Tue Jun 25 22:37:31 2013 +0200
@@ -808,7 +808,6 @@
 ! !
 
 
-
 !SmallInteger methodsFor:'bit operators'!
 
 bitAnd:anInteger
@@ -4018,16 +4017,27 @@
 %{  /* NOCONTEXT */
 
     if (__bothSmallInteger(min, max)) {
-	REGISTER INT selfVal;
-
-	selfVal = __intVal(self);
-	if (selfVal < __intVal(min)) {
-	     RETURN ( false );
-	}
-	if (selfVal > __intVal(max)) {
-	     RETURN ( false );
-	}
-	RETURN ( true );
+#if TAG_INT == 1
+        // tag bit does not change the magnitude order
+        if ((INT)self < (INT)(min)) {
+             RETURN ( false );
+        }
+        if ((INT)self > (INT)(max)) {
+             RETURN ( false );
+        }
+        RETURN ( true );
+#else
+        REGISTER INT selfVal;
+
+        selfVal = __intVal(self);
+        if (selfVal < __intVal(min)) {
+             RETURN ( false );
+        }
+        if (selfVal > __intVal(max)) {
+             RETURN ( false );
+        }
+        RETURN ( true );
+#endif
     }
 %}.
     (self < min) ifTrue:[^ false].
@@ -4222,11 +4232,11 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.207 2013-05-27 08:12:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.208 2013-06-25 20:37:31 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.207 2013-05-27 08:12:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.208 2013-06-25 20:37:31 cg Exp $'
 ! !