RosettaCodeData/Task/Non-decimal-radices-Input/Pluto/non-decimal-radices-input.pluto
2026-04-30 12:34:36 -04:00

7 lines
218 B
Text

local fmt = require "fmt"
local tests = { {"1110", 2}, {"112", 3}, {"16", 8}, {"14", 10}, {"e", 16}, {"e", 19} }
for tests as t do
local [n, b] = t
fmt.print("%6s in base %-2d = %d", n, b, tonumber(n, b))
end