BitShiftLeft

BitShiftLeft[n,k]

shifts the binary bits in the integer n to the left by k places, padding with zeros on the right.

BitShiftLeft[n]

shifts one bit to the left.

Details

  • BitShiftLeft[n,k] is equivalent to n2^k.
  • Negative values of k shift to the right.

Examples

open allclose all

Basic Examples  (1)

Shift 3 places to the left:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

See Also

BitShiftRight  RotateLeft  BitLength  BitGet  MantissaExponent  CellularAutomaton

Tutorials

Introduced in 2007
(6.0)