SHL Operator

Does a left shift operation on a bit pattern.

Syntax

pattern SHL number

Parts

pattern
An integer expression.
number
An integer expression.

Instructions

If pattern is a signed data type (Int8, Int16, Int32, Int, Int64, or Int128), then the operation is an arithmetic left shift. An arithmetic shift is ... TODO

If pattern is an unsigned data type (UInt8, UInt16, UInt32, UInt, UInt64, or UInt128), then the operation is a logical left shift. A logical shift is ... TODO

Examples

Var pattern As Int16 = 42
Var shift_0 = pattern SHL 0
Var shift_1 = pattern SHL 1
Var shift_8 = pattern SHL 8
Var shift_neg = pattern SHL -1
After execution
variablevalue
pattern 42 (&B00000000_00101010)
shift_0 42 (&B00000000_00101010)
shift_1 84 (&B00000000_01010100)
shift_8 10752 (&B00101010_00000000)
shift_neg 0 (&B00000000_00000000)

See also