local R={}R.E=2.718281828459 R.Tau=math.pi*2 function R.Lerp(R,w,e)return R+(w-R)*e end function R.LerpClamp(w,e,Q)return R.Lerp(w,e,math.clamp(Q,0,1))end function R.InverseLerp(R,w,e)return(e-R)/(w-R)end function R.Map(R,w,e,Q,S)return Q+(S-Q)*((R-w)/(e-w))end function R.Round(R)return R>=0 and math.floor(R+.5)or math.ceil(R-.5)end function R.RoundTo(w,e)return R.Round(w/e)*e end return R



local NumberUtil = {}


NumberUtil.E = 2.7182818284590
NumberUtil.Tau = math.pi * 2


function NumberUtil.Lerp(min, max, alpha)
	return (min + ((max - min) * alpha))
end


function NumberUtil.LerpClamp(min, max, alpha)
	return NumberUtil.Lerp(min, max, math.clamp(alpha, 0, 1))
end


function NumberUtil.InverseLerp(min, max, num)
	return ((num - min) / (max - min))
end


function NumberUtil.Map(n, inMin, inMax, outMin, outMax)
	return (outMin + ((outMax - outMin) * ((n - inMin) / (inMax - inMin))))
end


function NumberUtil.Round(num)
	return (num >= 0 and math.floor(num + 0.5) or math.ceil(num - 0.5))
end


function NumberUtil.RoundTo(num, multiple)
	return NumberUtil.Round(num / multiple) * multiple
end


return NumberUtil
