Reinterpret the bit pattern of an int32 as a real(sp).
Only ever reached on the foreign endian read path. The native path
reads real(sp) straight from the stream and never reinterprets
anything, which keeps the overwhelmingly common case entirely free of
any real/integer transfer.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | bits |
pure function bits_to_real_sp(bits) result(x) !! Reinterpret the bit pattern of an `int32` as a `real(sp)`. !! !! Only ever reached on the foreign endian read path. The native path !! reads `real(sp)` straight from the stream and never reinterprets !! anything, which keeps the overwhelmingly common case entirely free of !! any real/integer `transfer`. integer(int32), intent(in) :: bits real(sp) :: x x = transfer(bits, 0.0_sp) end function bits_to_real_sp