Skip to content

Commit

Permalink
fix: unexpected division by a zero-length vector in stddeviation
Browse files Browse the repository at this point in the history
  • Loading branch information
r3inbowari committed Nov 11, 2023
1 parent f5933ae commit c5e9ac7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions speedtest/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ func checkSum(data []byte) uint16 {
}

func StandardDeviation(vector []int64) (mean, variance, stdDev, min, max int64) {
if len(vector) == 0 {
return
}
var sumNum, accumulate int64
min = math.MaxInt64
max = math.MinInt64
Expand Down

0 comments on commit c5e9ac7

Please sign in to comment.