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

Called by

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

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