Use BIT to test any bit in an integer without having to manually search the integer for the desired bit value. The bit positions are numbered from 0 to 15 with 0 being the right-most or least significant bit position. If the bit is set BIT returns a 1, otherwise BIT returns a 0. An example of BIT follows:
BIT(12,3)
The number 12 is considered a binary number and tested in this manner:
12 = 0000000000001100
Bit 3 = 0000000000001000
BIT(12,3) = 1
The result is 1 because bit 3 is set in the number 12.