IntBitLeftShift (NoSQL query)
APPLIES TO: NoSQL
Shifts the left-hand operator left by the number of bits defined by its right-hand operand. For more information, see left shifts.
Syntax
IntBitLeftShift(<int_expr_1>, <int_expr_2>)
Arguments
Description | |
---|---|
int_expr_1 |
An integer expression, which is used as the left-hand operand. |
int_expr_2 |
An integer expression, which is used as the right-hand operand. |
Return types
Returns a 64-bit integer.
Note
For more information, see __int64.
Examples
This example tests the function with various static values.
SELECT VALUE {
shiftInteger: IntBitLeftShift(16, 4),
shiftDecimal: IntBitLeftShift(16, 0.4)
}
[
{
"shiftInteger": 256
}
]
Remarks
- This function expects integers for both arguments and performs operations assuming the values are a 64-bit integer.
- If any of the arguments aren't an integer, the function returns undefined.
- Overflow behavior is similar to the implementation in C++ (wrap-around).