Purpose |
The AND operator works as both a logical and a bitwise arithmetic operator. | ||||||||||||||||||
Syntax |
p AND q Using AND as a logical operator AND returns TRUE (non-zero) if (and only if) both its operands are TRUE. The AND truth table looks like this:
Using AND as a bitwise arithmetic operator AND masks clear selected bits of an integer-class value without affecting the other bits. For example, to clear the most-significant (leftmost) 2 bits in the integer value &H9700, AND it with &H3FFF. That is, the mask contains all 1s, except for the bit positions you want to force to 0: | ||||||||||||||||||
See also |
Arithmetic Operators, EQV, IMP, ISFALSE, ISTRUE, NOT, OR, XOR |