Skip to main content

BITWISEOR

BITWISEOR is a function that takes one or more integer parameters and returns the result of performing a bitwise OR operation on all of them.

A bitwise OR operation involves comparing the bits in the binary representation of two numbers, and keeping any bits that are 1 in either number. For example, if we perform a bitwise OR operation on the numbers 5 (binary 101) and 3 (binary 011), we get 7 (binary 111), since both the leftmost and rightmost bits are 1 in at least one of the two numbers.

Syntax

int BITWISEOR(params int[] values)

Example

BITWISEOR(5,3)

Returns 7

You can swap the value in the above function for a column that contains an array of integers or single integer. E.g. If you had an array of integers contained in the column MyIntegers the function would look like:

BITWISEOR(MyIntegers)