You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It converts the number to a string. And when the caller requires a number, the caller seems to convert the string back to a number. That seems computational less efficient than the linked implementation.
I have seen some places where a rounded number is required instead of a string.
Here is an efficient implementation of
round
in Lua: https://github.com/SanjoSolutions/LuaMathematics/blob/fe7048955fb41c03c4cbd6f1dfb94d3b65115d7d/Mathematics.lua#L27-L33You can copy it.
The text was updated successfully, but these errors were encountered: