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 > BitShiftRight >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation > Bitwise Operations > BitShiftRight >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Programming > Boolean Computation > Bitwise Operations > BitShiftRight >

BitShiftRight

BitShiftRight
shifts the binary bits in the integer n to the right by k places, dropping bits that are shifted past the unit's position on the right.
BitShiftRight[n]
shifts one bit to the right.
  • Negative values of k shift to the left.
Shift 3 places to the right:
Shift 7 places to the right, leaving no nonzero bits:
Shift 3 places to the right:
In[1]:=
Click for copyable input
Out[1]=
Shift 7 places to the right, leaving no nonzero bits:
In[2]:=
Click for copyable input
Out[2]=
BitShiftRight works with numbers of any size:
BitShiftRight automatically threads itself over lists:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF