Returns a uniform random number x
, such that: a <= x < b
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | a | |||
real(kind=wp), | intent(in) | :: | b |
function get_random_number(a,b) result(x) implicit none real(wp) :: x real(wp),intent(in) :: a real(wp),intent(in) :: b call random_number(x) x = a + (b-a)*x end function get_random_number