bit_size_R4P Function

private elemental function bit_size_R4P(i) result(bits)

Arguments

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

Return Value integer(kind=I1P)


Called by

proc~~bit_size_r4p~2~~CalledByGraph proc~bit_size_r4p~2 bit_size_R4P interface~bit_size~3 bit_size interface~bit_size~3->proc~bit_size_r4p~2

Contents

Source Code


Source Code

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

   bits = size(transfer(i, mold), dim=1, kind=I1P) * 8_I1P
   endfunction bit_size_R4P