LSHIFT(I, SHIFT) (IBM extension)

Purpose

Performs a logical shift to the left. It is identical to SHIFTL(I, SHIFT) (Fortran 2008).

Note: You are encouraged to use the standard intrinsic procedure rather than the equivalent 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 obtained by shifting the bits of I by SHIFT positions to the left.
  • Vacated bits are filled with zeros.
  • The bits are numbered 0 to BIT_SIZE(I)-1, from right to left.

Examples

LSHIFT (3, 1) has the result 6.

LSHIFT (3, 2) has the result 12.

Specific Name Argument Type Result Type Pass As Arg?
LSHIFT any integer same as argument yes


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