Skip to main content

BITWISEAND

BITWISEAND returns the result of performing a bitwise AND operation on all the given integer parameters.

A bitwise AND operation involves comparing the bits in the binary representation of two numbers, and only keeping the bits that are 1 in both numbers. For example, if we perform a bitwise AND operation on the numbers 5 (binary 101) and 3 (binary 011), we get 1 (binary 001), since the only bit that is 1 in both numbers is the rightmost bit.

Syntax

int BITWISEAND(params int[] values)

Example

If we had the following function:

BITWISEAND(5, 3, 7)

This would return 1 as the result. You can swap the values for a column containing an array of integers (MyIntegers) and the function would calculate the result for each row of data.

BITWISEAND(MyIntegers)