diff --git a/glm/helper.go b/glm/helper.go new file mode 100644 index 0000000..918bba1 --- /dev/null +++ b/glm/helper.go @@ -0,0 +1,7 @@ +package glm + +import "cmp" + +func Clamp[T cmp.Ordered] (low, high, val T) T { + return min(high, max(low, val)) +}