Adding dep files and dependencies.
This commit is contained in:
parent
45f9efa578
commit
b341c0a0e4
539 changed files with 313111 additions and 0 deletions
26
vendor/github.com/montanaflynn/stats/min.go
generated
vendored
Normal file
26
vendor/github.com/montanaflynn/stats/min.go
generated
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
package stats
|
||||
|
||||
import "math"
|
||||
|
||||
// Min finds the lowest number in a set of data
|
||||
func Min(input Float64Data) (min float64, err error) {
|
||||
|
||||
// Get the count of numbers in the slice
|
||||
l := input.Len()
|
||||
|
||||
// Return an error if there are no numbers
|
||||
if l == 0 {
|
||||
return math.NaN(), EmptyInput
|
||||
}
|
||||
|
||||
// Get the first value as the starting point
|
||||
min = input.Get(0)
|
||||
|
||||
// Iterate until done checking for a lower value
|
||||
for i := 1; i < l; i++ {
|
||||
if input.Get(i) < min {
|
||||
min = input.Get(i)
|
||||
}
|
||||
}
|
||||
return min, nil
|
||||
}
|
Reference in a new issue