Skip to content

Commit

Permalink
Use math.Sqrt in StandardDeviation (PR #64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzzed committed Apr 15, 2021
1 parent 8e3445d commit 6e25dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deviation.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func StandardDeviationPopulation(input Float64Data) (sdev float64, err error) {
vp, _ := PopulationVariance(input)

// Return the population standard deviation
return math.Pow(vp, 0.5), nil
return math.Sqrt(vp), nil
}

// StandardDeviationSample finds the amount of variation from a sample
Expand All @@ -53,5 +53,5 @@ func StandardDeviationSample(input Float64Data) (sdev float64, err error) {
vs, _ := SampleVariance(input)

// Return the sample standard deviation
return math.Pow(vs, 0.5), nil
return math.Sqrt(vs), nil
}

0 comments on commit 6e25dc5

Please sign in to comment.