mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Changed lume.round() such that 0 results in 0 rather than -0
This commit is contained in:
parent
037f5e3325
commit
6bff74e856
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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user