cambridge/libs/cpml/_private_utils.lua

17 lines
405 B
Lua
Raw Permalink Normal View History

2022-07-04 23:05:40 -05:00
-- Functions exported by utils.lua but needed by vec2 or vec3 (which utils.lua requires)
local private = {}
local floor = math.floor
local ceil = math.ceil
function private.round(value, precision)
if precision then return private.round(value / precision) * precision end
return value >= 0 and floor(value+0.5) or ceil(value-0.5)
end
function private.is_nan(a)
return a ~= a
end
return private