MERGE_BITS — Merge of bits under mask#
-
MERGE_BITS(I, J, MASK)#
MERGE_BITS(I, J, MASK)merges the bits ofIandJas determined by the mask. The i-th bit of the result is equal to the i-th bit ofIif the i-th bit ofMASKis 1; it is equal to the i-th bit ofJotherwise.- Parameters
I – Shall be of type
INTEGERor a boz-literal-constant.J – Shall be of type
INTEGERwith the same kind type parameter asIor a boz-literal-constant.IandJshall not both be boz-literal-constants.MASK – Shall be of type
INTEGERor a boz-literal-constant and of the same kind asI.
- Returns
The result is of the same type and kind as
I.
- Standard:
Fortran 2008 and later
- Class:
Elemental function
- Syntax:
RESULT = MERGE_BITS(I, J, MASK)