git @ Cat's Eye Technologies Dipple / master lua / modulo.lua
master

Tree @master (Download .tar.gz)

modulo.lua @masterraw · history · blame

-- SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
-- For more information, please refer to <https://unlicense.org/>
-- SPDX-License-Identifier: Unlicense

for i = -5,5,1 do
  for j = -5,5,1 do
    line = string.format("%2d mod %2d = ", i, j)
    if j == 0 then
      line = line .. "undefined"
    else
      line = line .. string.format("%d", i % j)
    end
    print(line)
  end
end