IBITS intrinsic function

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


<Syntax>

IBITS ( I, POS, LEN )

I : Integer;
POS : Integer, conformable with I, POS≥0;
LEN : Integer, conformable with I, LEN≥0, POS+LEN≤BIT_SIZE(I);

Result : Same type and kind as I.

<Semantics>

The value of the result is the LEN bits of I from POS to POS+LEN−1, right-shifted by POS places. This will be equal to IAND(SHIFTR(I, POS), MASKR(LEN, KIND(I))). This is an elemental function; if any argument is an array the result is an array of the same shape, with the IBITS operation being applied elementwise.

<Related>

BIT_SIZE intrinsic function, IAND intrinsic function, IBCLR intrinsic function, IBSET intrinsic function, MASKR intrinsic function, MVBITS intrinsic subroutine, SHIFTR intrinsic function