Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

SHIFTA

Elemental Intrinsic Function (Specific): Performs a right shift with fill. This function cannot be passed as an actual argument.

result = SHIFTA (i,shift)

i

(Input) Must be of type integer. This is the value to be shifted.

shift

(Input) Must be of type integer. It must be nonnegative and <= BIT_SIZE(i). This value is the number of positions to shift.

Results

The result type and kind are the same as i.

The result has the value obtained by shifting the bits of i to the right shift bits and replicating the leftmost bit of i in the left shift bits.

If shift is zero the result is i. Bits shifted off the right end are lost.

The model for the interpretation of an integer value as a sequence of bits is in Model for Bit Data.

Example

SHIFTA (IBSET (0, BIT_SIZE (0) - 1), 2) is equal to SHIFTL (7, BIT_SIZE (0) - 3).