Compute the number of bytes of a real variable.
use penf
print FI1P, byte_size(1._R4P)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R4P), | intent(in) | :: | i | Real variable whose number of bytes must be computed. |
Number of bytes of r.
elemental function byte_size_R4P(i) result(bytes)
!< Compute the number of bytes of a real variable.
!<
!<```fortran
!< use penf
!< print FI1P, byte_size(1._R4P)
!<```
!=> 4 <<<
real(R4P), intent(in) :: i !< Real variable whose number of bytes must be computed.
integer(I1P) :: bytes !< Number of bytes of r.
bytes = bit_size(i) / 8_I1P
endfunction byte_size_R4P