DSHIFTR(I, J, SHIFT) (Fortran 2008)

Purpose

Performs a combined shift to the right.

Class

Elemental function

Argument type and attributes

I
An INTENT(IN) INTEGER or boz-literal CONSTANT
J
An INTENT(IN) INTEGER or boz-literal CONSTANT

If both I and J are of type INTEGER, they must be the same kind. I and J must not both be boz-literal CONSTANT.

SHIFT
An INTENT(IN) INTEGER. Its value must be non-negative, and less than or equal to BIT_SIZE(I) when I is an INTEGER. Otherwise, it must be less than or equal to BIT_SIZE(J).

Result type and attributes

Same as I when I is of type integer. Otherwise, same as J.

Result value

Example

DSHIFTR (-50, -128, 30) has the result -197.