mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-24 13:19:01 -06:00
17 lines
405 B
Lua
17 lines
405 B
Lua
|
-- 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
|