math.fmod (x, y)

Returns the remainder of the division of x by y that rounds the quotient towards zero.