bit_size(i)
returns the number of bits (integer precision plus sign bit) represented by the type of i
.
Fortran 95 and later
result = bit_size(i)
i
- The type shall be integer
.The return value is of type integer
program test_bit_size
integer :: i = 123
integer :: size
size = bit_size(i)
print *, size
end program test_bit_size