binary_and()

Learn how to use the binary_and() function to compare bits in corresponding operands.

Performs a bitwise AND operation on two values.

Syntax

binary_and(value1,value2)

Parameters

NameTypeRequiredDescription
value1long✔️The left-hand value of the bitwise AND operation.
value2long✔️The right-hand value of the bitwise AND operation.

Returns

Returns the result of a bitwise AND operation between value1 and value2.

Examples

print result = binary_and(6, 3)

Output:

2