Bitwise Operators (Azure Stream Analytics)
Bitwise operators perform bit manipulations between two expressions of any of the data types of the integer data type category.
Overview
Bitwise operators convert two integer values to binary bits, perform the AND, OR, XOR, or NOT operation on each bit, producing a result. Then converts the result to an integer.
For example, the integer 170 converts to binary 1010 1010.
The integer 75 converts to binary 0100 1011.
operator | bitwise math |
---|---|
AND If bits at any location are both 1, the result is 1. |
1010 1010 = 170 0100 1011 = 75 ----------------- 0000 1010 = 10 |
OR If either bit at any location is 1, the result is 1. |
1010 1010 = 170 0100 1011 = 75 ----------------- 1110 1011 = 235 |
NOT Reverses the bit value at every bit location. |
1010 1010 = 170 ----------------- 0101 0101 = 85 |
Stream Analytics Query Language provides the following bitwise operators: