Skip to content

Commit

Permalink
Update skew.go
Browse files Browse the repository at this point in the history
  • Loading branch information
TimLai666 committed Sep 1, 2024
1 parent 8f844a1 commit a5c1988
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stats/skew.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check failure on line 66 in stats/skew.go

View workflow job for this annotation

GitHub Actions / build

syntax error: unexpected <<, expected }

stdev := sample.Stdev()
if stdev == nil {
Expand All @@ -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
}
Expand Down

0 comments on commit a5c1988

Please sign in to comment.