These functions operate on the 2's complement binary representation of an exact integer.
Returns the bit-wise logical "and" of the arguments. If no argument is given, the result is -1.
Returns the bit-wise logical "(inclusive) or" of the arguments. If no argument is given, the result is 0.
Returns the bit-wise logical "exclusive or" of the arguments. If no argument is given, the result is 0.
Returns true if the arguments have any bits in common. Same as
(not (zero? (logand
, but is more efficient.i
j
)))
Function: arithmetic-shift
i
j
Shifts
i
byj
. It is a "left" shift if, and a "right" shift if
j
>0.
j
<0The result is equal to
(floor (*
.i
(expt 2j
)))
Count the number of 1-bits in
i
, if it is non-negative. Ifi
is negative, count number of 0-bits.
Return number of bits needed to represent
i
in an unsigned field. Regardless of the sign ofi
, return one less than the number of bits needed for a field that can representi
as a two's complement integer.