8.7. Bitwise Functions

    Count the number of bits set in x (treated as bits-bit signed integer) in 2’s complement representation:

    bitwise_and(x, y) → bigint

    Returns the bitwise AND of x and y in 2’s complement representation.

    bitwise_not(x) → bigint

    Returns the bitwise NOT of x in 2’s complement representation.

    Returns the bitwise OR of and y in 2’s complement representation.

    bitwise_xor(x, y) → bigint

    Returns the bitwise XOR of x and y in 2’s complement representation.

    bitwise_shift_left(x, shift, bits) → bigint

    Left shift operation on x (treated as bits-bit integer) shifted by shift.

    (x, shift, bits) → bigint

    Logical right shift operation on x (treated as bits-bit integer) shifted by shift.

    bitwise_arithmetic_shift_right(x, shift) → bigint

    Arithmetic right shift operation on x shifted by shift in 2’s complement representation.

    See also bitwise_and_agg() and .