インテル® Fortran コンパイラー 19.0 デベロッパー・ガイドおよびリファレンス
Elemental Intrinsic Function (Generic): Performs a logical AND on corresponding bits. This function can also be specified as AND.
result = IAND (i,j)
i |
(Input) Must be of type integer or logical (which is treated as an integer), or a binary, octal, or hexadecimal literal constant. |
j |
(Input) Must be of type integer or logical, or a binary, octal, or hexadecimal literal constant. If both i and j are of type integer or logical, they must have the same kind type parameter. If the kinds of i and j do not match, the value with the smaller kind is extended with its sign bit on the left and the larger kind is used for the operation and the result. i and j must not both be binary, octal, or hexadecimal literal constants. |
If both i and j are of type integer or logical, the result type and kind are the same as i. If either i or j is a binary, octal, or hexadecimal literal constant, it is first converted as if by the intrinsic function INT to type integer with the kind type parameter of the other.
The result value is derived by combining i and j bit-by-bit according to the following truth table:
i j IAND (i, j) 1 1 1 1 0 0 0 1 0 0 0 0
The model for the interpretation of an integer value as a sequence of bits is shown in Model for Bit Data.
Specific Name |
Argument Type |
Result Type |
---|---|---|
BIAND |
INTEGER(1) |
INTEGER(1) |
IIAND 1 |
INTEGER(2) |
INTEGER(2) |
JIAND |
INTEGER(4) |
INTEGER(4) |
KIAND |
INTEGER(8) |
INTEGER(8) |
1Or HIAND. |
IAND (2, 3) has the value 2.
IAND (4, 6) has the value 4.
The following shows another example:
INTEGER(1) i, m
INTEGER result
INTEGER(2) result2
i = 1
m = 3
result = IAND(i,m) ! returns an integer of default type
! (INTEGER(4) unless reset by user) whose
! value = 1
result2 = IAND(i,m) ! returns an INTEGER(2) with value = 1