Elemental Intrinsic Function (Generic): Returns the logical complement of the argument.
result = NOT (i)
i |
(Input) Must be of type integer. |
The result type is the same as i. The result value is obtained by complementing i bit-by-bit according to the following truth table:
I NOT (I)
1 0
0 1
The model for the interpretation of an integer value as a sequence of bits is shown in Model for Bit Data.
If I has a value equal to 10101010 (base 2), NOT (I) has the value 01010101 (base 2).
The following shows another example:
INTEGER(2) i(2), j(2)
i = (/4, 132/) ! i(1) = 0000000000000100
! i(2) = 0000000010000100
j = NOT(i) ! returns (-5,-133)
! j(1) = 1111111111111011
! j(2) = 1111111101111011