Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation > Bitwise Operations >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation > Bitwise Operations >

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.
  • Negative values of k shift to the right.
Shift 3 places to the left:
Shift 3 places to the left:
In[1]:=
Click for copyable input
Out[1]=
BitShiftLeft works with numbers of any size:
BitShiftLeft automatically threads itself over lists:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team