Shift

angerangel edited this page Jan 7, 2013 · 1 revision
Clone this wiki locally

USAGE

   SHIFT value bits /logical

DESCRIPTION

Shifts an integer left or right by a number of bits.

SHIFT is a native value.

ARGUMENTS

  • value (integer!)
  • bits -- Positive for left shift, negative for right shift (integer!)

REFINEMENTS

  • /logical -- Logical shift (sign bit ignored)

#SOURCE

shift: make native! [  [
    {Shifts an integer left or right by a number of bits.}
    value [integer!]
    bits [integer!] "Positive for left shift, negative for right shift"
    /logical "Logical shift (sign bit ignored)"
] ]