bit_size
- Date:
10-12-2011
NAME
BIT_SIZE - Returns the number of bits in an integer in the bit manipulation model
SYNOPSIS
BIT_SIZE ([I=]i)
IMPLEMENTATION
Cray Linux Environment (CLE)
STANDARDS
Fortran
DESCRIPTION
The BIT_SIZE intrinsic function returns the number of bits s as defined by the bit model. The bit model is described in the models(3i) man page. This intrinsic function accepts the following argument:
- i
Must be of type integer
BIT_SIZE is an inquiry function. The name of this intrinsic cannot be passed as an argument.
RETURN VALUES
The result is a scalar integer with the same kind type parameter as i.
The result has the value of the number of bits s in the model integer defined in the DESCRIPTION section of this man page.
EXAMPLES
The following code fragment shows the data size for explicit kind types of integer and default integer:
INTEGER(KIND=1) I1
INTEGER(KIND=2) I2
INTEGER(KIND=4) I4
INTEGER(KIND=8) I8
INTEGER ID
PRINT *,'BIT_SIZE I1=',BIT_SIZE(I1)
PRINT *,'BIT_SIZE I2=',BIT_SIZE(I2)
PRINT *,'BIT_SIZE I4=',BIT_SIZE(I4)
PRINT *,'BIT_SIZE I8=',BIT_SIZE(I8)
PRINT *,'BIT_SIZE ID=',BIT_SIZE(ID)
END
On the output is as follows:
BIT_SIZE I1= 8
BIT_SIZE I2= 16
BIT_SIZE I4= 32
BIT_SIZE I8= 64
BIT_SIZE ID= 32
Note: The -s default32 option is enabled by default. So the size of ID is 32 bits.
SEE ALSO
models(3i)