Description: | Extracts a sequence of bits (a bit field). | ||
Class: | Elemental function; Generic | ||
Arguments: | I | Must be of type integer. | |
POS | Must be of type integer. It must not be
negative and POS + LEN must be less than or equal to BIT_SIZE (I).
The rightmost (least significant) bit of I is in position 0. | ||
LEN | Must be of type integer. It must not be negative. | ||
Results: | The result type is the same as I. The
result has the value of the sequence of LEN bits in I, beginning at
POS right-adjusted and with all other bits zero.
For more information on bit functions, see Section 9.2.3. The model for the interpretation of an integer value as a sequence of bits is shown in Section D.3. |
Specific Name | Argument Type | Result Type |
---|---|---|
INTEGER(1) | INTEGER(1) | |
IIBITS | INTEGER(2) | INTEGER(2) |
JIBITS | INTEGER(4) | INTEGER(4) |
KIBITS | INTEGER(8) | INTEGER(8) |
Examples
IBITS (12, 1, 4) has the value 6.
IBITS (10, 1, 7) has the value 5.