adventofcode/2018/internal/util/math.go

16 lines
139 B
Go
Raw Normal View History

2018-12-12 20:06:59 +00:00
package util
2018-12-12 21:46:57 +00:00
func Abs(x int) int {
2018-12-12 20:06:59 +00:00
if x < 0 {
return -x
}
return x
}
2018-12-12 21:46:57 +00:00
func Min(i, j int) int {
if i < j {
return i
}
return j
}