summaryrefslogtreecommitdiff
path: root/ms/ms_test.go
diff options
context:
space:
mode:
authorWill Hawkins <[email protected]>2022-11-07 18:27:00 -0500
committerWill Hawkins <[email protected]>2022-11-07 18:30:47 -0500
commitd88338dcf0a53ef48eb0a8064da6e284395f5d29 (patch)
tree726a49e0ce6fd98975117fd097d601c208d04ff3 /ms/ms_test.go
parent4a0fd25ae07063361a83d5bfda55306eaf3e426e (diff)
[Refactor] Change standard-deviation calculation API slightly
Diffstat (limited to 'ms/ms_test.go')
-rw-r--r--ms/ms_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ms/ms_test.go b/ms/ms_test.go
index 86a5488..6f1e807 100644
--- a/ms/ms_test.go
+++ b/ms/ms_test.go
@@ -67,7 +67,7 @@ func Test_SequentialIncreasesAlwaysLessThanWithWraparoundInverse(test *testing.T
}
}
-func Test_StandardDeviationLessThan_Float(test *testing.T) {
+func Test_StandardDeviationCalculation(test *testing.T) {
series := NewMathematicalSeries[float64](5)
// 5.7, 1.0, 8.6, 7.4, 2.2
series.AddElement(5.7)
@@ -76,7 +76,7 @@ func Test_StandardDeviationLessThan_Float(test *testing.T) {
series.AddElement(7.4)
series.AddElement(2.2)
- if islt, sd := series.StandardDeviationLessThan(2.94); !islt {
+ if _, sd := series.StandardDeviation(); !utilities.ApproximatelyEqual(2.93, sd, 0.01) {
test.Fatalf("Standard deviation max calculation failed: %v.", sd)
} else {
test.Logf("Standard deviation calculation result: %v", sd)