SHIFTA(I, SHIFT) (Fortran 2008)

Purpose

Performs an arithmetic shift to the right. It is identical to RSHIFT(I, SHIFT) (IBM extension).

Class

Elemental function

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 that is obtained by shifting the bits of I by SHIFT positions to the right.
  • Vacated bits are filled with the sign bit, leftmost bit of I.
  • The bits are numbered 0 to BIT_SIZE(I)-1, from right to left.

Example

SHIFTA (-68, 4) has the result -4.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us