Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I1P), | intent(in) | :: | n | Real to be converted. |
Returned bit-string containing input number.
Convert integer to string of bits.
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.
!---------------------------------------------------------------------------------------------------------------------------------
integer(I1P), intent(in) :: n !< Real to be converted.
character(8) :: bstr !< Returned bit-string containing input number.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
write(bstr, '(B8.8)') n
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction bstr_I1P