Use math.fmod(x,y) which does what you want:
Returns the remainder of the division of x by y that rounds the
quotient towards zero.
http://www.lua.org/manual/5.2/manual.html#pdf-math.fmod
Use math.fmod(x,y) which does what you want:
Returns the remainder of the division of x by y that rounds the
quotient towards zero.
http://www.lua.org/manual/5.2/manual.html#pdf-math.fmod