fixed minor bugs; cleaned up tests
This commit is contained in:
parent
4f00ae5a5a
commit
10335fd726
19 changed files with 243 additions and 701 deletions
|
|
@ -129,25 +129,25 @@ proc variance*(x: openArray[float]): float {.noSideEffect.} =
|
|||
result = result + diff*diff
|
||||
result = result / toFloat(len(x))
|
||||
|
||||
proc random*(max: int): int {.gcsafe.}
|
||||
proc random*(max: int): int {.benign.}
|
||||
## returns a random number in the range 0..max-1. The sequence of
|
||||
## random number is always the same, unless `randomize` is called
|
||||
## which initializes the random number generator with a "random"
|
||||
## number, i.e. a tickcount.
|
||||
|
||||
proc random*(max: float): float {.gcsafe.}
|
||||
proc random*(max: float): float {.benign.}
|
||||
## returns a random number in the range 0..<max. The sequence of
|
||||
## random number is always the same, unless `randomize` is called
|
||||
## which initializes the random number generator with a "random"
|
||||
## number, i.e. a tickcount. This has a 16-bit resolution on windows
|
||||
## and a 48-bit resolution on other platforms.
|
||||
|
||||
proc randomize*() {.gcsafe.}
|
||||
proc randomize*() {.benign.}
|
||||
## initializes the random number generator with a "random"
|
||||
## number, i.e. a tickcount. Note: Does nothing for the JavaScript target,
|
||||
## as JavaScript does not support this.
|
||||
|
||||
proc randomize*(seed: int) {.gcsafe.}
|
||||
proc randomize*(seed: int) {.benign.}
|
||||
## initializes the random number generator with a specific seed.
|
||||
## Note: Does nothing for the JavaScript target,
|
||||
## as JavaScript does not support this.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue