Home / lang / lsr 
Lsr
Syntax
Value = Lsr ( Number , Bit AS Integer )

Returns Number shifted to the right by Bit bits. 0 bits are shifted from the left into the sign bit.

The type of Number may be Byte, Short, Integer, or Long

The valid range of Bit depends on the type of the Number argument:

Type Range of Bit
Byte 0...15
Short 0...15
Integer 0...31
Long 0...63

Example
PRINT Lsr(11, 3)

1

Example
PRINT Lsr(-11, 3)

536870910

Lsr with a negative Short Number argument will have as result a Short which has 32 bits, bits 16 to 31 are the result of shifted pattern &HFFFF0000&

This is a Bug of Verion 1.9.28

Example
PRINT Lsr(CShort(&HCa83), 4)

268434600


See also
Bits Manipulation Functions  Logical Operators