Turn a 64-bit random word into a real(dp) in [0, 1) using its top 53
bits. See the next_real_dp interface documentation for the exactness
argument.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | word |
pure function real_from_word(word) result(r) !! Turn a 64-bit random word into a `real(dp)` in [0, 1) using its top 53 !! bits. See the `next_real_dp` interface documentation for the exactness !! argument. integer(int64), intent(in) :: word real(dp) :: r r = real(ibits(word, 11, 53), dp)*TWO_TO_MINUS_53 end function real_from_word