bctoi_I4P Function

private elemental function bctoi_I4P(bstr, knd) result(n)

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: bstr
integer(kind=I4P), intent(in) :: knd

Return Value integer(kind=I4P)


Calls

proc~~bctoi_i4p~4~~CallsGraph proc~bctoi_i4p~4 bctoi_I4P interface~str~4 str proc~bctoi_i4p~4->interface~str~4 proc~strf_i2p~4 strf_I2P interface~str~4->proc~strf_i2p~4 proc~str_a_r8p~4 str_a_R8P interface~str~4->proc~str_a_r8p~4 proc~str_a_i4p~4 str_a_I4P interface~str~4->proc~str_a_i4p~4 proc~str_r8p~4 str_R8P interface~str~4->proc~str_r8p~4 proc~strf_i8p~4 strf_I8P interface~str~4->proc~strf_i8p~4 proc~str_i8p~4 str_I8P interface~str~4->proc~str_i8p~4 proc~str_bol~4 str_bol interface~str~4->proc~str_bol~4 proc~strf_i1p~4 strf_I1P interface~str~4->proc~strf_i1p~4 proc~str_a_r4p~4 str_a_R4P interface~str~4->proc~str_a_r4p~4 proc~strf_r8p~4 strf_R8P interface~str~4->proc~strf_r8p~4 proc~str_i2p~4 str_I2P interface~str~4->proc~str_i2p~4 proc~str_a_i2p~4 str_a_I2P interface~str~4->proc~str_a_i2p~4 proc~strf_i4p~4 strf_I4P interface~str~4->proc~strf_i4p~4 proc~str_i4p~4 str_I4P interface~str~4->proc~str_i4p~4 proc~str_a_i8p~4 str_a_I8P interface~str~4->proc~str_a_i8p~4 proc~strf_r4p~4 strf_R4P interface~str~4->proc~strf_r4p~4 proc~str_r4p~4 str_R4P interface~str~4->proc~str_r4p~4 proc~str_i1p~4 str_I1P interface~str~4->proc~str_i1p~4 proc~str_a_i1p~4 str_a_I1P interface~str~4->proc~str_a_i1p~4 proc~str_a_r8p~4->proc~str_r8p~4 proc~str_a_i4p~4->proc~str_i4p~4 proc~compact_real_string~4 compact_real_string proc~str_r8p~4->proc~compact_real_string~4 proc~str_a_r4p~4->proc~str_r4p~4 proc~str_a_i2p~4->proc~str_i2p~4 proc~str_a_i8p~4->proc~str_i8p~4 proc~str_r4p~4->proc~compact_real_string~4 proc~str_a_i1p~4->proc~str_i1p~4

Called by

proc~~bctoi_i4p~4~~CalledByGraph proc~bctoi_i4p~4 bctoi_I4P interface~bcton~4 bcton interface~bcton~4->proc~bctoi_i4p~4

Contents

Source Code


Source Code

   elemental function bctoi_I4P(bstr, knd) result(n)
   !< Convert bit-string to integer.
   !<
   !<```fortran
   !< use penf
   !< print FI4P, bcton('00000000000000000000000000000001', knd=1_I4P)
   !<```
   !=> 1 <<<
   character(*), intent(in) :: bstr !< String containing input number.
   integer(I4P), intent(in) :: knd  !< Number kind.
   integer(I4P)             :: n    !< Number returned.

   read(bstr,'(B'//trim(str(bit_size(knd), .true.))//'.'//trim(str(bit_size(knd), .true.))//')') n
   endfunction bctoi_I4P