github.com/psexton/git-lfs@v2.1.1-0.20170517224304-289a18b2bc53+incompatible/tools/math.go (about) 1 package tools 2 3 // MinInt returns the smaller of two `int`s, "a", or "b". 4 func MinInt(a, b int) int { 5 if a < b { 6 return a 7 } 8 9 return b 10 } 11 12 // MaxInt returns the greater of two `int`s, "a", or "b". 13 func MaxInt(a, b int) int { 14 if a > b { 15 return a 16 } 17 18 return b 19 } 20 21 // MinInt64 returns the smaller of two `int`s, "a", or "b". 22 func MinInt64(a, b int64) int64 { 23 if a < b { 24 return a 25 } 26 27 return b 28 } 29 30 // MaxInt64 returns the greater of two `int`s, "a", or "b". 31 func MaxInt64(a, b int64) int64 { 32 if a > b { 33 return a 34 } 35 36 return b 37 }