Back to top

ReQL command: bit_and

Command syntax

r.bit_and(number) → number

r.bit_and(number[, number, ...]) → number

Description

A bitwise AND is a binary operation that takes two equal-length binary representations and performs the logical AND operation on each pair of the corresponding bits, which is equivalent to multiplying them. Thus, if both bits in the compared position are 1, the bit in the resulting binary representation is 1 (1 × 1 = 1); otherwise, the result is 0 (1 × 0 = 0 and 0 × 0 = 0).

Example:

r.expr(5).bit_and(3).run(conn)

# Result:
1

Get more help

Couldn't find what you were looking for?