bstr_R16P Function

private elemental function bstr_R16P(n) result(bstr)

Arguments

Type IntentOptional AttributesName
real(kind=R16P), intent(in) :: n

Real to be converted.

Return Value character(len=128)

Returned bit-string containing input number.

Description

Convert real to string of bits.


Source Code

  elemental function bstr_R16P(n) result(bstr)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Convert real to string of bits.
  !<
  !< @note It is assumed that R16P is represented by means of 128 bits, but this is not ensured in all architectures.
  !---------------------------------------------------------------------------------------------------------------------------------
  real(R16P), intent(in) :: n    !< Real to be converted.
  character(128)         :: bstr !< Returned bit-string containing input number.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  write(bstr, '(B128.128)') n
  return
  !---------------------------------------------------------------------------------------------------------------------------------
  endfunction bstr_R16P