This commit is contained in:
Araq 2017-02-26 00:31:56 +01:00
commit 2589d69ed2
12 changed files with 58 additions and 42 deletions

View file

@ -95,7 +95,7 @@ proc random*(max: float): float {.benign.} =
proc random*[T](x: Slice[T]): T =
## For a slice `a .. b` returns a value in the range `a .. b-1`.
result = random(x.b - x.a) + x.a
result = T(random(x.b - x.a)) + x.a
proc random*[T](a: openArray[T]): T =
## returns a random element from the openarray `a`.