Next: , Previous: Integer-basic, Up: Integer


1.89.4 Integer: bit operators

allMask: anInteger
True if all 1 bits in anInteger are 1 in the receiver


anyMask: anInteger
True if any 1 bits in anInteger are 1 in the receiver


bitAt: index
Answer the index-th bit of the receiver (the LSB has an index of 1)


bitAt: index put: value
Answer an integer which is identical to the receiver, possibly with the exception of the index-th bit of the receiver (the LSB having an index of 1), which assumes a value equal to the low-order bit of the second parameter.


bitClear: aMask
Answer an Integer equal to the receiver, except that all the bits that are set in aMask are cleared.


bitInvert
Return the 1's complement of the bits of the receiver


clearBit: index
Clear the index-th bit of the receiver and answer a new Integer


highBit
Return the index of the highest order 1 bit of the receiver.


isBitSet: index
Answer whether the index-th bit of the receiver is set


lowBit
Return the index of the lowest order 1 bit of the receiver.


noMask: anInteger
Answer true if no 1 bits in anInteger are 1 in the receiver.


setBit: index
Set the index-th bit of the receiver and answer a new Integer