9.3.64 IBSET (I, POS)

Description:  Sets one bit to 1.  
Class:  Elemental function; Generic 
Arguments:  I Must be of type integer.  
  POS Must be of type integer. It must not be negative and it must be less than BIT_SIZE (I).
The rightmost (least significant) bit of I is in position 0. 
Results:  The result type is the same as I. The result has the value of the sequence of bits of I, except that bit POS of I is set to 1.

For more information on bit functions, see Section 9.2.3.

The model for the interpretation of an integer value as a sequence of bits is shown in Section D.3

Specific Name  Argument Type  Result Type 
  INTEGER(1)  INTEGER(1) 
IIBSET  INTEGER(2)  INTEGER(2) 
JIBSET  INTEGER(4)  INTEGER(4) 
KIBSET  INTEGER(8)  INTEGER(8) 

Examples

IBSET (8, 1) has the value 10.

If V has the value (1, 2, 3, 4), the value of IBSET (POS = V, I = 2) is (2, 6, 10, 18).


Previous Page Next Page Table of Contents