mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 02:52:21 +00:00
Changed lume.round() such that 0 results in 0 rather than -0
This commit is contained in:
2
lume.lua
2
lume.lua
@@ -78,7 +78,7 @@ end
|
|||||||
|
|
||||||
function lume.round(x, increment)
|
function lume.round(x, increment)
|
||||||
if increment then return lume.round(x / increment) * increment end
|
if increment then return lume.round(x / increment) * increment end
|
||||||
return x > 0 and math_floor(x + .5) or math_ceil(x - .5)
|
return x >= 0 and math_floor(x + .5) or math_ceil(x - .5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user