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

ID 767251
Date 3/22/2024
Public

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

Document Table of Contents

MASKR

Elemental Intrinsic Function (Generic): Returns a right-justified mask.

result = MASKR (i[,kind])

i

(Input) Must be of type integer or of type logical (which is treated as an integer). It must be nonnegative and less than or equal to the number of bits s of the model integer defined for bit manipulation contexts.

kind

(Input; optional) Must be a scalar integer constant expression.

Results

The result type is integer. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.

The result value has its rightmost I bits set to 1 and the remaining bits set to 0.

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

Example

MASKR (3) has the value 7.

See Also