bit_size_R16P Function

private elemental function bit_size_R16P(i) result(bits)

Arguments

TypeIntentOptionalAttributesName
real(kind=R16P), intent(in) :: i

Return Value integer(kind=I2P)


Contents

Source Code


Source Code

   elemental function bit_size_R16P(i) result(bits)
   !< Compute the number of bits of a real variable.
   !<
   !<```fortran
   !< use penf
   !< print FI2P, bit_size(1._R16P)
   !<```
   !=> 128 <<<
   real(R16P), intent(in) :: i       !< Real variable whose number of bits must be computed.
   integer(I2P)           :: bits    !< Number of bits of r.
   integer(I1P)           :: mold(1) !< "Molding" dummy variable for bits counting.

   bits = size(transfer(i, mold), dim=1, kind=I2P) * 8_I2P
   endfunction bit_size_R16P