bit_size_chr Function

private elemental function bit_size_chr(i) result(bits)

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: i

Return Value integer(kind=I4P)


Called by

proc~~bit_size_chr~7~~CalledByGraph proc~bit_size_chr~7 bit_size_chr interface~bit_size~13 bit_size interface~bit_size~13->proc~bit_size_chr~7

Contents

Source Code


Source Code

   elemental function bit_size_chr(i) result(bits)
   !< Compute the number of bits of a character variable.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, bit_size('ab')
   !<```
   !=> 16 <<<
   character(*), intent(IN) :: i       !< Character variable whose number of bits must be computed.
   integer(I4P)             :: bits    !< Number of bits of c.
   integer(I1P)             :: mold(1) !< "Molding" dummy variable for bits counting.

   bits = size(transfer(i, mold), dim=1, kind=I4P) * 8_I4P
   endfunction bit_size_chr