IBSET(I, POS)

Purpose

Sets one bit to one.

Class

Elemental function

Argument Type and Attributes

I
must be of type integer.

POS
must be of type integer. It must be nonnegative and less than BIT_SIZE (I).

Result Type and Attributes

Same as I.

Result Value

The result has the value of the sequence of bits of I, except that bit POS of I is set to one.

The bits are numbered from 0 to BIT_SIZE(I)-1, from right to left.

Examples

IBSET (12, 1) has the value 14.

If V has the value (/1, 2, 3, 4/), the value of IBSET (POS = V, I = 0) is (/2, 4, 8, 16/).

See .


Specific Name Argument Type Result Type Pass As Arg?
IBSET (1) any integer same as I yes

Notes:

  1. IBM Extension.
IBM Copyright 2003