Lua replacement for the % operator

It’s not ideal, but according to the Lua 5.2 Reference Manual:

a % b == a – math.floor(a/b)*b

Leave a Comment