Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0
Syntax
x & y | bitAnd(x | y)
Parameters
Name
Type
Description
x
number | BigNumber | bigint | Array | Matrix
First value to and
y
number | BigNumber | bigint | Array | Matrix
Second value to and
Returns
number | BigNumber | bigint | Array | Matrix — AND of `x` and `y`
Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.
Syntax
x | y | bitOr(x | y)
Parameters
Name
Type
Description
x
number | BigNumber | bigint | Array | Matrix
First value to or
y
number | BigNumber | bigint | Array | Matrix
Second value to or
Returns
number | BigNumber | bigint | Array | Matrix — OR of `x` and `y`
Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.
Syntax
bitXor(x | y)
Parameters
Name
Type
Description
x
number | BigNumber | bigint | Array | Matrix
First value to xor
y
number | BigNumber | bigint | Array | Matrix
Second value to xor
Returns
number | BigNumber | bigint | Array | Matrix — XOR of `x` and `y`