DOCUMENTATION CENTER SEARCH
Mathematica
>
Bitwise Operations
>
Built-in
Mathematica
Symbol
Integer and Number Theoretic Functions
Tutorials »
|
BitShiftLeft
Quotient
RotateRight
BitLength
BitGet
MantissaExponent
CellularAutomaton
See Also »
|
Bitwise Operations
New in 6.0: Number Theory & Integer Functions
More About »
BitShiftRight
BitShiftRight
[
n
,
k
]
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.
MORE INFORMATION
BitShiftRight
[
n
,
k
]
is equivalent to
IntegerPart
[
n
/2^
k
]
.
Negative values of
k
shift to the left.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Shift 3 places to the right:
In[1]:=
Out[1]=
Shift 7 places to the right, leaving no nonzero bits:
In[2]:=
Out[2]=
Scope
(2)
SEE ALSO
BitShiftLeft
Quotient
RotateRight
BitLength
BitGet
MantissaExponent
CellularAutomaton
TUTORIALS
Integer and Number Theoretic Functions
MORE ABOUT
Bitwise Operations
New in 6.0: Number Theory & Integer Functions
New in 6
© 2008 Wolfram Research, Inc.