This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

bitwise left shift

Summary

Left shifts the bits of an expression.

Syntax

result = expression1 << expression2
result
Any variable.
expression1
Any expression.
expression2
Any expression.

Examples

The << operator shifts the bits of expression1 left by the number of bits specified in expression2. For example, the variable temp has a value of 56 because 14 (00001110 in binary) shifted left two bits equals 56 (00111000 in binary).

var temp
temp = 14 << 2

See also

Other articles

Attributions

  • Microsoft Developer Network: Article