Module:Powharmonic series: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 5: | Line 5: | ||
local n = tonumber(frame.args["n"]) | local n = tonumber(frame.args["n"]) | ||
local expo = tonumber(frame.args["expo"]) | local expo = tonumber(frame.args["expo"]) | ||
local | local result = "{| class=\"wikitable center-all\"\n" | ||
.. "|+ style=\"font-size: 105%;\" | " .. string.format("Intervals of the %s-Powharmonic series\n", expo) | .. "|+ style=\"font-size: 105%;\" | " .. string.format("Intervals of the %s-Powharmonic series\n", expo) | ||
.. "|-\n" | .. "|-\n" | ||
| Line 18: | Line 18: | ||
for i = 1, n do | for i = 1, n do | ||
p_current = 1200 * math.log(i) / math.log(2) * expo | p_current = 1200 * math.log(i) / math.log(2) * expo | ||
result = result | |||
.. "|-\n" | .. "|-\n" | ||
.. "| ".. string.format("%s", i) | .. "| ".. string.format("%s", i) | ||
| Line 30: | Line 30: | ||
end | end | ||
result = result .. "|}" | |||
local debugg = yesno(frame.args["debug"]) | local debugg = yesno(frame.args["debug"]) | ||
return frame:preprocess(debugg == true and "< | return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" or result) | ||
end | end | ||
return p | return p | ||