floating point checks
This commit is contained in:
parent
911c1cb301
commit
3b7ef2288f
30 changed files with 611 additions and 631 deletions
|
|
@ -101,7 +101,7 @@ proc mean*(x: openarray[float]): float {.noSideEffect.} =
|
|||
result = sum(x) / toFloat(len(x))
|
||||
|
||||
proc variance*(x: openarray[float]): float {.noSideEffect.} =
|
||||
## computes the mean of the elements in `x`.
|
||||
## computes the variance of the elements in `x`.
|
||||
## If `x` is empty, NaN is returned.
|
||||
result = 0.0
|
||||
var m = mean(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue