Add tests for RuleTargetAxis.
This commit is contained in:
parent
8f3b8f4b47
commit
6646044d28
8 changed files with 164 additions and 9 deletions
|
@ -13,3 +13,13 @@ func AbsInt[T constraints.Integer](value T) T {
|
|||
func LerpInt[T constraints.Integer](min, max T, t float64) T {
|
||||
return T((1-t)*float64(min) + t*float64(max))
|
||||
}
|
||||
|
||||
func ClampInt[T constraints.Integer](value, min, max T) T {
|
||||
if value < min {
|
||||
value = min
|
||||
}
|
||||
if value > max {
|
||||
value = max
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue