renamefest
This commit is contained in:
parent
fc0fda14ae
commit
2f43fdb837
62 changed files with 342 additions and 343 deletions
|
|
@ -278,11 +278,11 @@ else:
|
|||
proc `mod`*(x, y: float): float =
|
||||
result = if y == 0.0: x else: x - y * (x/y).floor
|
||||
|
||||
proc random*[T](x: TSlice[T]): T =
|
||||
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
|
||||
|
||||
proc random[T](a: openarray[T]): T =
|
||||
proc random[T](a: openArray[T]): T =
|
||||
## returns a random element from the openarray `a`.
|
||||
result = a[random(a.low..a.len)]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue