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, Int64, or Int128), the operation is an arithmetic left shift. An arithmetic shift is ... TODO

If pattern is an unsigned data type (UInt8, UInt16, UInt32, UInt64, or UInt128), 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 run
variablevalue
pattern    42 (00000000 00101010)
shift_0    42 (00000000 00101010)
shift_1    84 (00000000 01010100)
shift_8 10752 (00101010 00000000)
shift_neg     0 (00000000 00000000)

See also