Performs a bitwise AND.

Syntax

BITAND(<expN1>, <expN2>)

<expN1>
<expN2>

Two 32-bit integers

Description

BITAND( ) compares bits in the numeric value <expN1> with corresponding bits in the numeric value <expN2>. When both bits in the same position are on (set to 1), the corresponding bit in the returned value is on. In any other case, the bit is off (set to 0).

AND

0

1

0

0

0

1

0

0

Use BITAND( ) to force individual bits to zero. Create a bit mask: a 32-bit integer with zeroes in the bits you want to force to zero and ones in the bits you want to leave alone. Use this bit mask as either one of the parameters to BITAND( ), and the other parameter as the number that is modified.