Module:Q-odd-limit intervals: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m Multiple lines is easier to read
Line 126: Line 126:
error_list = find_error(val, subgroup, monzo_list)
error_list = find_error(val, subgroup, monzo_list)
for i = 1, #error_list do
for i = 1, #error_list do
ratiocomp = string.format("%d/%d, %d/%d", error_list[i].ratio.num, error_list[i].ratio.den, 2 * error_list[i].ratio.den, error_list[i].ratio.num)
ratiocomp = string.format("%d/%d, %d/%d",
error_list[i].ratio.num, error_list[i].ratio.den,
2 * error_list[i].ratio.den, error_list[i].ratio.num)
eav = error_list[i].error_abs_val
eav = error_list[i].error_abs_val
erv = error_list[i].error_rel_val
erv = error_list[i].error_rel_val
Line 136: Line 138:
error_rel_direct = string.format("%.1f", erd)
error_rel_direct = string.format("%.1f", erd)
if bit32.band(error_list[i].ratio.den, error_list[i].ratio.den - 1) == 0 and utils.table_contains(subgroup, error_list[i].ratio.num) then -- check power of 2 for den and prime for num
if bit32.band(error_list[i].ratio.den, error_list[i].ratio.den - 1) == 0
and utils.table_contains(subgroup, error_list[i].ratio.num) then -- check power of 2 for den and prime for num
ratiocomp = "'''" .. ratiocomp .. "'''"
ratiocomp = "'''" .. ratiocomp .. "'''"
error_abs_val = "'''" .. error_abs_val .. "'''"
error_abs_val = "'''" .. error_abs_val .. "'''"
Line 174: Line 177:
end
end
table.sort(errlist_direct, function(a, b) return a.ead < b.ead end)
table.sort(errlist_direct, function(a, b)
return a.ead < b.ead
end)
for i = 1, #error_list do
for i = 1, #error_list do
Line 192: Line 197:
.. "|+ style=\"font-size: 105%; white-space: nowrap;\" | "
.. "|+ style=\"font-size: 105%; white-space: nowrap;\" | "
local t_head_1 = "|-\n"
local t_head_1 = "|-\n"
.. "! class=\"unsortable\" | Interval and complement !! Error (abs, [[Cent|¢]]) !! Error (rel, [[Relative cent|%]])\n"
.. "! class=\"unsortable\" | Interval and complement"
.. " !! Error (abs, [[Cent|¢]])"
.. " !! Error (rel, [[Relative cent|%]])\n"
local t_foot = "\n|}"
local t_foot = "\n|}"