first commit
This commit is contained in:
24
util/math.go
Normal file
24
util/math.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package util
|
||||
|
||||
func MinInt(x, y int) int{
|
||||
if x>y {
|
||||
return y
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func MaxInt(x, y int) int{
|
||||
if x<y {
|
||||
return y
|
||||
}
|
||||
return x
|
||||
}
|
||||
|
||||
func AbsInt(x int) int{
|
||||
if x > 0{
|
||||
return x
|
||||
}else {
|
||||
return -x
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user