Module:ET: Difference between revisions

Use another newline
Plumtree (talk | contribs)
m tempers_out() implemented
Line 89: Line 89:
return math.floor(exact + 0.5)
return math.floor(exact + 0.5)
end
end
end
-- whether this ET tempers out the provided rational number
function p.tempers_out(et, ratio)
local t = 0
for factor, power in pairs(ratio) do
if type(factor) == 'number' then
t = t + power * p.approximate(et, factor)
end
end
return t == 0
end
end