math扩展库新增interval方法

This commit is contained in:
MrZ626
2021-12-20 15:19:53 +08:00
parent 04f38d2eb6
commit 2e0ceaae72

View File

@@ -20,4 +20,14 @@ function MATH.coin(a,b)
end
end
function MATH.interval(v,low,high)
if v<=low then
return low
elseif v>=high then
return high
else
return v
end
end
return MATH