ISHFTC(I, SHIFT, SIZE)

Purpose

Performs a circular shift of the rightmost bits; that is, bits shifted off one end are inserted again at the other end.

Class

Elemental function

Argument type and attributes

I
An INTENT(IN) INTEGER
SHIFT
An INTENT(IN) INTEGER. The absolute value of SHIFT must be less than or equal to SIZE.
SIZE (optional)
An INTENT(IN) INTEGER. The value of SIZE must be positive and must not exceed BIT_SIZE (I). If SIZE is absent, it is as if it were present with the value of BIT_SIZE (I).

Result type and attributes

Same as I.

Result value

The result has the value obtained by shifting the SIZE rightmost bits of I circularly by SHIFT positions. If SHIFT is positive, the shift is to the left; if SHIFT is negative, the shift is to the right; and, if SHIFT is zero, no shift is performed. No bits are lost. The unshifted bits are unaltered.

The bits are numbered 0 to BIT_SIZE(I)-1, from right to left.

Examples

ISHFTC (3, 2, 3) has the value 5. See Integer bit model.

Specific Name Argument Type Result Type Pass As Arg?
ISHFTC  1  any integer same as argument yes  2 
Note:
  •  1  IBM extension
  •  2  When this specific name is passed as an argument, the procedure can only be referenced with all three arguments.