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 |
PRINT Lsr(11, 3) <hr>1
PRINT Lsr(-11, 3) <hr>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 PRINT Lsr(CShort(&HCa83), 4) <hr>268434600 |