Performs a "bitwise and" operation on the binary representation of two numbers.Syntax:
<number1> bitAnd <number2>
Examples:
0 bitAnd 1 -- evaluates to 0
3 bitAnd 2 -- in binary: 11 bitAnd 10; evaluates to 10; converted to 2
Use the bitAnd operator to operate directly on the bits of two numbers.
To perform the bitAnd operation, LiveCode first converts both operands to their binary equivalent, a string of ones and zeroes. 1 is equivalent to true, and 0 is equivalent to false.
For each bit of number1, LiveCode performs an and operation with the corresponding bit of number2 to produce a result. A bit is 1 if the corresponding bits of number1 and number2 are both 1. Otherwise, the bit is 0.
Finally, the binary number thus created is converted back to decimal.
Parameters:
- number1: The number1 and number2 are numbers, or expressions that evaluate tonumbers, between zero and 4,294,967,295 (2^32 - 1).
- number2:
- Description:Use the bitAnd operator to operate directly on the bits of twonumbers.