1.4.6 Bitwise Operations
Multiplies x by 2^y. This is equivalent to shifting the binary representation of x to the left by y bits.
Bitwise logical operations on numbers. These forms compute the bitwise AND, inclusive OR, exclusive OR, and equivalence (a.k.a. exclusive NOR), respectively. These macros expand into calls of binary functions such as binary-logand, binary-logior, etc. The guards of these functions require that all inputs be integers. When passed one argument, these functions return the argument unchanged. When passed no arguments, logand and logeqv return -1, while logior and logxor return 0.
Examples: | ||||||||||||||||||||
|
Computes the bitwise logical NAND of the two given numbers.
Example: | ||
|
Computes the bitwise logical NOR of x and y.
Example: | ||
|
Computes the bitwise logical NOT of the given number.
Example: | ||
|
Returns the ith bit in the two’s complement binary representation of j.
Returns the number of "on" bits in the binary representation of x.
Computes the bitwise logical Inclusive OR of y with the bitwise logical NOT of x.
Example: | ||
|
Computes the bitwise logical Inclusive OR of x with the bitwise logical NOT of y.
Example: | ||
|
Returns true if and only if x and y share a ’1’ bit somewhere in their binary representation (i.e. (logand x y) is not zero).