BIT_SIZE(I)

Purpose

Returns the number of bits in an integer type. Because only the type of the argument is examined, the argument need not be defined.

Class

Inquiry function

Argument type and attributes

I
must be of type integer.

Result type and attributes

Scalar integer with the same kind type parameter as I.

Result value

The result is the number of bits in the integer data type of the argument:

IBM Extension
    type                   bits
-----------                ------
 integer(1)                    8
 integer(2)                   16
 integer(4)                   32
 integer(8)                   64
End of IBM Extension

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

Examples

BIT_SIZE (1_4) has the value 32, because the integer type with kind 4 (that is, a four-byte integer) contains 32 bits.