Add math.clamp

This commit is contained in:
Lars Mueller 2022-05-10 19:44:27 +02:00
parent ead91a1e5d
commit b52fee94af

@ -23,6 +23,10 @@ function sign(number)
if number > 0 then return 1 end
end
function clamp(number, min, max)
return math.min(math.max(number, min), max)
end
log = setmetatable({}, {
__index = function(self, base)
local div = math.log(base)