Skip to main content

$bitLeftShift

The $bitLeftShift operator performs a bitwise left shift operation on the first integer by the second integer number of positions.

Input

  • An array containing exactly two integer values: the value to shift and the number of positions to shift

Output

  • The result of shifting the first value left by the specified number of positions

Examples

Basic Left Shift

Result: 10 (binary: 101 “left shift” 1 = 1010)

Multiple Position Shift

Result: 12 (binary: 011 “left shift” 2 = 1100)

Field Value

Result: The value field left-shifted by the positions field