Purpose
Performs an arithmetic shift to
the right. It is identical to SHIFTA(I, SHIFT) (Fortran 2008).
Note: You are
encouraged to use the standard intrinsic procedure rather than the
equivalent IBM extension.
Argument type and attributes
- I
- An INTENT(IN) INTEGER
- SHIFT
- An INTENT(IN) INTEGER. Its value must be non-negative
and less than or equal to BIT_SIZE(I).
Result type and attributes
Same as I.
Result value
- The result has the value obtained by shifting the bits of I by
SHIFT positions to the right.
- Vacated bits are filled with the sign bit.
- The bits are numbered 0 to BIT_SIZE(I)-1, from right to left.
Examples
RSHIFT (3,
1) has the result 1.
RSHIFT (3, 2)
has the result 0.
RSHIFT (-1, 32)
has the result -1.
Specific Name |
Argument Type |
Result Type |
Pass As Arg? |
RSHIFT |
any integer |
same as argument |
yes |