Module:Interval table: Difference between revisions
m Style |
This get_"monzo" is no different from rat.new |
||
| Line 4: | Line 4: | ||
local ud = require("Module:Ups and downs notation") | local ud = require("Module:Ups and downs notation") | ||
local ET = require("Module:ET") | local ET = require("Module:ET") | ||
local PRIME_LIST = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, | local PRIME_LIST = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, | ||
101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, | 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, | ||
211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271} | 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271} | ||
-- Gets mapping of a monzo in a val | -- Gets mapping of a monzo in a val | ||
| Line 59: | Line 28: | ||
(i / j) >= 1 | (i / j) >= 1 | ||
and (i / j) <= max_size | and (i / j) <= max_size | ||
and | and rat.max_prime(rat.new (i, j)) <= prime_limit | ||
and not utils.table_contains(ratio_strings, t) | and not utils.table_contains(ratio_strings, t) | ||
then | then | ||
| Line 113: | Line 82: | ||
[43] = ET.approximate(et, 43), | [43] = ET.approximate(et, 43), | ||
[47] = ET.approximate(et, 47), | [47] = ET.approximate(et, 47), | ||
} | } -- NOTE: indices are prime numbers | ||
local t_head = '{| class="wikitable center-1 right-2"\n' | local t_head = '{| class="wikitable center-1 right-2"\n' | ||
| Line 175: | Line 144: | ||
-- If they are mapped to the current step in the ET's patent val and <2/5 edo step error, | -- If they are mapped to the current step in the ET's patent val and <2/5 edo step error, | ||
-- add to approximate ratios column. | -- add to approximate ratios column. | ||
local t = mapping( | local t = mapping(rat.new(ratios_list[j][1], ratios_list[j][2]), patent_val) | ||
if | if | ||
t == i | t == i | ||