mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
remove pow function
This commit is contained in:
parent
a42f42aa06
commit
6ccd8d2685
1 changed files with 1 additions and 1 deletions
|
|
@ -62,7 +62,7 @@ func (rep *Reporter) Run() {
|
||||||
// calculate sum of squares from data provided by metrics.Histogram
|
// calculate sum of squares from data provided by metrics.Histogram
|
||||||
// see http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods
|
// see http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods
|
||||||
func sumSquares(icount int64, mean, stDev float64) float64 {
|
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) {
|
if math.IsNaN(sumSquares) {
|
||||||
return 0.0
|
return 0.0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue