
Bitwise "and"



Bitwise "or"



Bitwise "xor"



Reverse all the bits in the argument



shift x i shifts x left by i bits if i is positive,
or right by i bits otherwise.
Right shifts perform sign extension on signed number types;
i.e. they fill the top bits with 1 if the x is negative
and with 0 otherwise.
An instance can define either this unified shift or shiftL and
shiftR, depending on which is more convenient for the type in
question.



rotate x i rotates x left by i bits if i is positive,
or right by i bits otherwise.
For unbounded types like Integer, rotate is equivalent to shift.
An instance can define either this unified rotate or rotateL and
rotateR, depending on which is more convenient for the type in
question.



bit i is a value with the ith bit set



x `setBit` i is the same as x .. bit i



x `clearBit` i is the same as x .&. complement (bit i)



x `complementBit` i is the same as x `xor` bit i



Return True if the nth bit of the argument is 1



Return the number of bits in the type of the argument. The actual
value of the argument is ignored. The function bitSize is
undefined for types that do not have a fixed bitsize, like Integer.



Return True if the argument is a signed type. The actual
value of the argument is ignored



Shift the argument left by the specified number of bits
(which must be nonnegative).
An instance can define either this and shiftR or the unified
shift, depending on which is more convenient for the type in
question.



Shift the first argument right by the specified number of bits
(which must be nonnegative).
Right shifts perform sign extension on signed number types;
i.e. they fill the top bits with 1 if the x is negative
and with 0 otherwise.
An instance can define either this and shiftL or the unified
shift, depending on which is more convenient for the type in
question.



Rotate the argument left by the specified number of bits
(which must be nonnegative).
An instance can define either this and rotateR or the unified
rotate, depending on which is more convenient for the type in
question.



Rotate the argument right by the specified number of bits
(which must be nonnegative).
An instance can define either this and rotateL or the unified
rotate, depending on which is more convenient for the type in
question.
