SmallInteger.st
changeset 4613 a722d598c1bb
parent 4523 28d9633c9cb4
child 4644 2003eaf6381d
equal deleted inserted replaced
4612:724572ee0390 4613:a722d598c1bb
   741 
   741 
   742 %{  /* NOCONTEXT */
   742 %{  /* NOCONTEXT */
   743 
   743 
   744     /* anding the tags doesn't change it */
   744     /* anding the tags doesn't change it */
   745     if (__isSmallInteger(anInteger)) {
   745     if (__isSmallInteger(anInteger)) {
   746 	RETURN ( ((OBJ) ((INT)self & (INT)anInteger)) );
   746         RETURN ( ((OBJ) ((INT)self & (INT)anInteger)) );
   747     }
   747     }
   748 %}.
   748 %}.
       
   749     anInteger class == LargeInteger ifTrue:[
       
   750         ^ anInteger bitAnd:self
       
   751     ].
   749     ^ self retry:#bitAnd: coercing:anInteger
   752     ^ self retry:#bitAnd: coercing:anInteger
   750 
   753 
   751     "(2r001010100 bitAnd:2r00001111) radixPrintStringRadix:2"
   754     "(2r001010100 bitAnd:2r00001111) radixPrintStringRadix:2"
   752 !
   755 !
   753 
   756 
   933 
   936 
   934 %{  /* NOCONTEXT */
   937 %{  /* NOCONTEXT */
   935 
   938 
   936     /* and all bits except tag */
   939     /* and all bits except tag */
   937     if (__isSmallInteger(aMask)) {
   940     if (__isSmallInteger(aMask)) {
   938 	RETURN ( ((INT)self & ((INT)aMask & ~TAG_MASK)) ? true : false );
   941         RETURN ( ((INT)self & ((INT)aMask & ~TAG_MASK)) ? true : false );
   939     }
   942     }
   940 %}.
   943 %}.
       
   944     aMask class == LargeInteger ifTrue:[
       
   945         ^ (aMask bitAnd:self) ~~ 0
       
   946     ].
   941     ^ self retry:#bitTest: coercing:aMask
   947     ^ self retry:#bitTest: coercing:aMask
   942 !
   948 !
   943 
   949 
   944 bitXor:anInteger
   950 bitXor:anInteger
   945     "return the bitwise-exclusive-or of the receiver and the argument, anInteger"
   951     "return the bitwise-exclusive-or of the receiver and the argument, anInteger"
  2899 ! !
  2905 ! !
  2900 
  2906 
  2901 !SmallInteger class methodsFor:'documentation'!
  2907 !SmallInteger class methodsFor:'documentation'!
  2902 
  2908 
  2903 version
  2909 version
  2904     ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.116 1999-08-04 14:10:55 cg Exp $'
  2910     ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.117 1999-08-19 00:14:26 cg Exp $'
  2905 ! !
  2911 ! !