# bitwise right shift: >>, shr

bit shift to the right as many time shifts the input number to the right as many as the value of the second input. output bits will be lost and the input bits will be 0. bit shift to the right can be used to divide the power of 2. example 256 divided by 2 on the third: 256 we shift to the right three times and the result is 32.## >>

### Description

`par1 >> par2`

### Input

- par1 - any integer
- par2 - any integer

### Output

- Result - integers

compatible programing languages:

Visual Basic .NET | C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

Visual Basic .NET | C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

### Examples

## Example

bitwise right shift the possible of use:```
x = 8 >> 1; // x = 4
y = 0xff >> 4; // y = 15
z = (x >> 2) >> 2; // z = 0
```

## Example

even one example in what situations we can use the operation bitwise right shift:```
i >> 2
2 >> i
32 >> (0xA >> 2) >> 1
```

## Example

Other pieces of example codes:(32 >>2)

2 >> 2

## shr

### Description

`par1 shr par2`

### Input

- par1 - any integer
- par2 - any integer

### Output

- Result - integers

### Examples

## Object 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
```

## Object 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
```

## Object Pascal

Other pieces of example codes:(32 shr 2)

2 shr 2

you can find it in the following collections: bitwise operators

bitwise right shift in another programming language: