next up previous contents index
Next: LinearCombinationType Up: IntegerType Previous: random   Contents   Index


shift


Usage

shift(a, n)
shift!(a, n)


Signature

shift: (%, MachineInteger) $\to$ %


Parameter Type Description
a % an integer
n MachineInteger a machine integer


Returns

Returns $a$ shifted left $n$ times if $n \ge 0$, shifted right $-n$ times if $n \le 0$.


Remarks

shift! does not make a copy of $x$, which is therefore modified after the call. It is unsafe to use the variable $x$ after the call, unless it has been assigned to the result of the call, as in x := shift!(x, n).



Manuel Bronstein 2004-06-28