bit.logicalAnd

Syntax bit.logicalAnd (bits1, bits2)

Params bits1 is a 32-bit number.

bits2 is a 32-bit number.

Action Performs the logical AND on the two values

Returns The logical AND of bits1 and bits2

Examples bit.logicalAnd (10, 7) // only bit 2 is set in both

   » 2

string.hex (bit.logicalAnd (0x1FFFF, 0x22000))

   » "0x2000"

See Also bit.logicalOr

bit.logicalXOr

Discuss