Convert integer to string of bits.
It is assumed that I2P is represented by means of 16 bits, but this is not ensured in all architectures.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=I2P), | intent(in) | :: | n | Real to be converted. |
Returned bit-string containing input number.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
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