The logical [[AND]] numerical operator compares two values in respect of their bits. If both bits at a certain position in both values are set, then that bit position is set in the result.
* [[AND]] compares the bits of the {{Parameter|firstvalue}} against the bits of the {{Parameter|secondvalue}}, the result is stored in the {{Parameter|result}} variable.
* If both bits are on (1) then the result is on (1).
:The 101 bit pattern equals 5 and the 011 bit pattern equals 3, it returns the bit pattern 001 which equals 1. Only the Least Significant Bits (LSB) match. So decimal values 5 AND 3 = 1.
::''Note:'' The value of 32767 sets 15 bits. -1 sets all 16 bits. Negative values will all have the highest bit set. Use [[LONG]] variables for input values to prevent overflow errors.