bitroll ( x s w -- y )
Factor handbook » The language » Numbers » Arithmetic » Bitwise arithmetic » Additional bitwise arithmetic

Prev:wrap ( m n -- m' )
Next:bitroll-32 ( m s -- n )


Vocabulary
math.bitwise

Inputs
xan integer
sa shift integer
wa wrap integer


Outputs
yan integer


Word description
Roll n by s bits to the left, wrapping around after w bits.

Examples
USING: math.bitwise prettyprint ; 1 -1 32 bitroll .b
0b10000000000000000000000000000000

USING: math.bitwise prettyprint ; 0xffff0000 8 32 bitroll .h
0xff0000ff


See also
bitroll-32, bitroll-64

Definition