2016-11-03 16:46:40 +00:00
|
|
|
package tools
|
|
|
|
|
2016-11-09 01:50:52 +00:00
|
|
|
// MinInt returns the smaller of two `int`s, "a", or "b".
|
2016-11-03 16:46:40 +00:00
|
|
|
func MinInt(a, b int) int {
|
|
|
|
if a < b {
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
return b
|
|
|
|
}
|
|
|
|
|
2016-11-09 01:50:52 +00:00
|
|
|
// MaxInt returns the greater of two `int`s, "a", or "b".
|
2016-11-03 16:46:40 +00:00
|
|
|
func MaxInt(a, b int) int {
|
|
|
|
if a > b {
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
return b
|
|
|
|
}
|