updates
This commit is contained in:
parent
e53554fb04
commit
88499d5576
4 changed files with 443 additions and 8 deletions
27
matrix/util.go
Normal file
27
matrix/util.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package matrix
|
||||
|
||||
import (
|
||||
"math"
|
||||
)
|
||||
|
||||
func minInt(values ...int) int {
|
||||
min := math.MaxInt32
|
||||
|
||||
for x := 0; x < len(values); x++ {
|
||||
if values[x] < min {
|
||||
min = values[x]
|
||||
}
|
||||
}
|
||||
return min
|
||||
}
|
||||
|
||||
func maxInt(values ...int) int {
|
||||
max := math.MinInt32
|
||||
|
||||
for x := 0; x < len(values); x++ {
|
||||
if values[x] > max {
|
||||
max = values[x]
|
||||
}
|
||||
}
|
||||
return max
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue