remove ginext/mongoext (no-dep lib)
This commit is contained in:
13
mathext/math.go
Normal file
13
mathext/math.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package mathext
|
||||
|
||||
func AvgFloat64(arr []float64) float64 {
|
||||
return SumFloat64(arr) / float64(len(arr))
|
||||
}
|
||||
|
||||
func SumFloat64(arr []float64) float64 {
|
||||
sum := 0.0
|
||||
for _, v := range arr {
|
||||
sum += v
|
||||
}
|
||||
return sum
|
||||
}
|
Reference in New Issue
Block a user