Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=I2P), | intent(in) | :: | n | Real to be converted. |
Returned bit-string containing input number.
Convert integer to string of bits.
elemental function bstr_I2P(n) result(bstr)
!---------------------------------------------------------------------------------------------------------------------------------
!< Convert integer to string of bits.
!<
!< @note It is assumed that I2P is represented by means of 16 bits, but this is not ensured in all architectures.
!---------------------------------------------------------------------------------------------------------------------------------
integer(I2P), intent(in) :: n !< Real to be converted.
character(16) :: bstr !< Returned bit-string containing input number.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
write(bstr, '(B16.16)') n
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction bstr_I2P