bstr_I1P Function

private elemental function bstr_I1P(n) result(bstr)

Convert integer to string of bits.

 use penf
 print "(A)", bstr(n=1_I1P)

Arguments

TypeIntentOptionalAttributesName
integer(kind=I1P), intent(in) :: n

Real to be converted.

Return Value character(len=8)

Returned bit-string containing input number.


Called by

proc~~bstr_i1p~~CalledByGraph proc~bstr_i1p bstr_I1P interface~bstr bstr interface~bstr->proc~bstr_i1p program~volatile_doctest~57 volatile_doctest program~volatile_doctest~57->interface~bstr program~volatile_doctest~27 volatile_doctest program~volatile_doctest~27->interface~bstr program~volatile_doctest~7 volatile_doctest program~volatile_doctest~7->interface~bstr program~volatile_doctest~29 volatile_doctest program~volatile_doctest~29->interface~bstr program~volatile_doctest~6 volatile_doctest program~volatile_doctest~6->interface~bstr program~volatile_doctest~60 volatile_doctest program~volatile_doctest~60->interface~bstr program~volatile_doctest~62 volatile_doctest program~volatile_doctest~62->interface~bstr

Contents

Source Code


Source Code

   elemental function bstr_I1P(n) result(bstr)
   !< Convert integer to string of bits.
   !<
   !< @note It is assumed that I1P is represented by means of 8 bits, but this is not ensured in all architectures.
   !<
   !<```fortran
   !< use penf
   !< print "(A)", bstr(n=1_I1P)
   !<```
   !=> 00000001 <<<
   integer(I1P), intent(in) :: n    !< Real to be converted.
   character(8)             :: bstr !< Returned bit-string containing input number.

   write(bstr, '(B8.8)') n
   endfunction bstr_I1P