IBSET (The GNU Fortran Compiler)

### 8.151 `IBSET` — Set bit ¶

Synopsis:

  `RESULT = IBSET(I, POS)`

Description:

  `IBSET` returns the value of I with the bit at position POS set to one.

Class:

  Elemental function

Arguments:

  I | The type shall be `INTEGER` or `UNSIGNED`.
  POS | The type shall be `INTEGER`.

Return value:

  The return value is of the same type as I.

Specific names:

  Name | Argument | Return type | Standard
  --- | --- | --- | ---
  `IBSET(A)` | `INTEGER A` | `INTEGER` | Fortran 90 and later
  `BBSET(A)` | `INTEGER(1) A` | `INTEGER(1)` | GNU extension
  `IIBSET(A)` | `INTEGER(2) A` | `INTEGER(2)` | GNU extension
  `JIBSET(A)` | `INTEGER(4) A` | `INTEGER(4)` | GNU extension
  `KIBSET(A)` | `INTEGER(8) A` | `INTEGER(8)` | GNU extension

Standard:

  Fortran 90 and later, has overloads that are GNU extensions. Extension for `UNSIGNED` (see Unsigned integers)

See also:

  `IBCLR` — Clear bit,
  `IBITS` — Bit extraction,
  `IAND` — Bitwise logical and,
  `IOR` — Bitwise logical or,
  `IEOR` — Bitwise logical exclusive or,
  `MVBITS` — Move bits from one integer to another