>> Operator

Purpose

Shifts a bit pattern right.

Syntax

i = m >> n

Description

m>>n shifts the bit pattern of a 32-bit integer expressions m, n places right and thereby changes the value in m.

Example

OpenW # 1

Print Bin$(202, 16)      // Prints 0000000011001010

Print Bin$(202 >> 4, 16) // Prints 0000000000001100

Remarks

Shr(m, n) is synonymous with m>>n and can be used instead. As long as the result of the shift does not exceed the given width, m>>n is equivalent to a division of m by 2^n.

See Also

<<, Shl, Shr, Sar, Rol, Ror, Operator Hierarchy

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}