diff --git a/math.lua b/math.lua index 98e82fc..f2c8054 100644 --- a/math.lua +++ b/math.lua @@ -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) @@ -124,4 +128,4 @@ function fround(number) end -- Export environment -return _ENV \ No newline at end of file +return _ENV