remove pow function

This commit is contained in:
Aaron Chen 2024-04-23 16:37:30 +08:00 committed by GitHub
parent a42f42aa06
commit 6ccd8d2685
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,7 @@ func (rep *Reporter) Run() {
// calculate sum of squares from data provided by metrics.Histogram
// see http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods
func sumSquares(icount int64, mean, stDev float64) float64 {
sumSquares := float64(icount) * (math.Pow(mean, 2) + math.Pow(stDev, 2))
sumSquares := float64(icount) * (mean * mean + stDev * stDev)
if math.IsNaN(sumSquares) {
return 0.0
}