C++ <-> Pascal | Bitwise right shift
C++ Used keywords: >>
>>
Description
par1 >> par2
Input
- par1 - Any integer
- par2 - Any integer
Output
- Result - Integers
Examples
C++
Bitwise right shift the possible of use:x = 8 >> 1; // x = 4
y = 0xff >> 4; // y = 15
z = (x >> 2) >> 2; // z = 0
C++
Even one example in what situations we can use the operation bitwise right shift:i >> 2
2 >> i
32 >> (0xA >> 2) >> 1
.
Pascal Used keywords: shr
shr
Description
par1 shr par2
Input
- par1 - Any integer
- par2 - Any integer
Output
- Result - Integers
Examples
Pascal
Bitwise right shift the possible of use:x := 8 shr 1; { x = 4}
y := $ff shr 4; { y = 15}
z := (x shr 2) shr 2; { z = 0}
Pascal
Even one example in what situations we can use the operation bitwise right shift:i shr 2
2 shr i
32 shr ($A shr 2) shr 1
You can find it in the following collections: bitwise operators
Bitwise right shift in another programming language:
Differences to:
Share