Module:Q-odd-limit intervals: Difference between revisions
Restore some strings we used to use |
use utils.table_contains and utils.value_provided where possible |
||
| Line 7: | Line 7: | ||
local PRIME_LIST = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31} | local PRIME_LIST = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31} | ||
local function table_filter(t, thres) | local function table_filter(t, thres) | ||
| Line 144: | Line 135: | ||
error_abs_direct = string.format("%.3f", ead) | error_abs_direct = string.format("%.3f", ead) | ||
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 | 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 224: | Line 215: | ||
local apx = string.lower(frame.args["apx"]:gsub("%s+", "")) | local apx = string.lower(frame.args["apx"]:gsub("%s+", "")) | ||
if title | if not utils.value_provided (title) then | ||
title = string.format("%d-odd-limit intervals in " .. steps .. "edo", limit) | title = string.format("%d-odd-limit intervals in " .. steps .. "edo", limit) | ||
end | end | ||