bctoi_I2P Function

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

Convert bit-string to integer.

 use penf
 print FI2P, bcton('0000000000000001', knd=1_I2P)

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: bstr

String containing input number.

integer(kind=I2P), intent(in) :: knd

Number kind.

Return Value integer(kind=I2P)

Number returned.


Calls

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

Called by

proc~~bctoi_i2p~~CalledByGraph proc~bctoi_i2p bctoi_I2P interface~bcton bcton interface~bcton->proc~bctoi_i2p program~volatile_doctest volatile_doctest program~volatile_doctest->interface~bcton program~volatile_doctest~35 volatile_doctest program~volatile_doctest~35->interface~bcton program~volatile_doctest~37 volatile_doctest program~volatile_doctest~37->interface~bcton program~volatile_doctest~13 volatile_doctest program~volatile_doctest~13->interface~bcton program~volatile_doctest~26 volatile_doctest program~volatile_doctest~26->interface~bcton program~volatile_doctest~82 volatile_doctest program~volatile_doctest~82->interface~bcton program~volatile_doctest~90 volatile_doctest program~volatile_doctest~90->interface~bcton

Contents

Source Code


Source Code

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

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