20 lines
221 B
Go
20 lines
221 B
Go
|
package buf2d
|
||
|
|
||
|
func limit(v, min, max int) int {
|
||
|
return getmax(getmin(v, max), min)
|
||
|
}
|
||
|
|
||
|
func getmax(x, y int) int {
|
||
|
if x > y {
|
||
|
return x
|
||
|
}
|
||
|
return y
|
||
|
}
|
||
|
|
||
|
func getmin(x, y int) int {
|
||
|
if x < y {
|
||
|
return x
|
||
|
}
|
||
|
return y
|
||
|
}
|