|
|
|
@ -14,7 +14,7 @@ local algo = {}
|
|
|
|
|
--
|
|
|
|
|
-- @number x value to clamp.
|
|
|
|
|
-- @number a interval lower bound (inclusive).
|
|
|
|
|
-- @number b interval upper bound (includive).
|
|
|
|
|
-- @number b interval upper bound (inclusive).
|
|
|
|
|
-- @treturn number clamped value.
|
|
|
|
|
function algo.clamp(x, a, b) return min(max(x, a), b) end
|
|
|
|
|
|
|
|
|
|