/ lang / shr Value = Shr ( Number , Bit AS Integer )
Returns Number shifted to the right by Bit bits. The sign of Number is kept. (Except if Number is a Byte)
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 Shr(11, 3)
1
PRINT Shr(-11, 3)
-2
![]() |
Asr with a negative Byte Number argument will not keep
the sign because the datatype Byte is always unsigned.
PRINT Asr(CByte(-64), 2) |