From a5c1988c7fe835417337fd1920b7ee3ab9db40d8 Mon Sep 17 00:00:00 2001 From: TimLai666 <43640816+TimLai666@users.noreply.github.com> Date: Sun, 1 Sep 2024 16:45:10 +0800 Subject: [PATCH] Update skew.go --- stats/skew.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats/skew.go b/stats/skew.go index 3ef055a..f5e9477 100644 --- a/stats/skew.go +++ b/stats/skew.go @@ -63,6 +63,7 @@ func calculateSkewPearson(sample insyra.IDataList) interface{} { } THREE := new(big.Rat).SetInt64(3) numerator := new(big.Rat).Mul(THREE, new(big.Rat).Sub(mean, median)) +<<<<<<< Updated upstream stdev := sample.Stdev() if stdev == nil { @@ -72,6 +73,10 @@ func calculateSkewPearson(sample insyra.IDataList) interface{} { denominator := new(big.Rat).SetFloat64(stdev.(float64)) if denominator.Cmp(new(big.Rat).SetInt64(0)) == 0 { +======= + denominator := sample.Stdev(true).(*big.Rat) + if denominator == new(big.Rat).SetFloat64(0.0) { +>>>>>>> Stashed changes insyra.LogWarning("DataList.Skew(): Denominator is 0, returning nil.") return nil }