Elemental Intrinsic Function (Generic): Performs an inclusive OR on corresponding bits. This function can also be specified as OR.
Syntax
result = IOR (i, j)
i
(Input) Must be of type integer.
j
(Input) Must be of type integer with the same kind parameter as i.
Results
The result type is the same as i. The result value is derived by combining i and j bit-by-bit according to the following truth table:
i j IOR (i, j)
1 1 1
1 0 1
0 1 1
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 |
---|---|---|
BIOR | INTEGER(1) | INTEGER(1) |
IIOR 1 | INTEGER(2) | INTEGER(2) |
JIOR | INTEGER(4) | INTEGER(4) |
KIOR | INTEGER(8) | INTEGER(8) |
1 Or HIOR. |
See Also
Examples
IOR (1, 4) has the value 5.
IOR (1, 2) has the value 3.
The following shows another example:
INTEGER result
result = IOR(240, 90) ! returns 250