percentage/percent
This commit is contained in:
parent
b15c99f695
commit
e4c410621d
1 changed files with 2 additions and 2 deletions
4
util.go
4
util.go
|
@ -136,8 +136,8 @@ func Seq(start, end float64, steps ...float64) []float64 {
|
||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
|
|
||||||
// PercentageDifference computes the percentage difference between two values.
|
// PercentDifference computes the percentage difference between two values.
|
||||||
// The formula is (v2-v1)/v1.
|
// The formula is (v2-v1)/v1.
|
||||||
func PercentageDifference(v1, v2 float64) float64 {
|
func PercentDifference(v1, v2 float64) float64 {
|
||||||
return (v2 - v1) / v1
|
return (v2 - v1) / v1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue