Module:Primes in edo fs: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}
local p = {}
local yesno = require("Module:Yesno")


-- greatest common divisor of a and b
-- greatest common divisor of a and b
Line 108: Line 110:
   local titleMarkup = ""
   local titleMarkup = ""
   if title then
   if title then
  titleMarkup = "|-\n|+ style=\"font-size: 105%;\" | " .. title .. "\n"
  titleMarkup = "|+ style=\"font-size: 105%;\" | " .. title .. "\n"
   end
   end
   local data_rows = ""
   local data_rows = "|-"..border_style.."\n" .. table.concat(tabs, "\n|") .. "\n"
  data_rows = data_rows .. "|-"..border_style.."\n" .. table.concat(tabs, "\n|") .. "\n"
.. "|-\n" .. table.concat(trel, "\n|") .. "\n"
  data_rows = data_rows .. "|-\n" .. table.concat(trel, "\n|") .. "\n"
.. "|-"..border_style.."\n" .. table.concat(tdeg, "\n|") .. "\n"
  data_rows = data_rows .. "|-"..border_style.."\n" .. table.concat(tdeg, "\n|") .. "\n"
.. "|-\n" .. table.concat(tdegor, "\n|") .. "\n"
  data_rows = data_rows .. "|-\n" .. table.concat(tdegor, "\n|") .. "\n"
    
    
   if fs_enable then
   if fs_enable then
Line 154: Line 155:
   -- optional EDO number, default: 12
   -- optional EDO number, default: 12
   local edo = eval_num_arg(frame.args["edo"], 12)
   local edo = eval_num_arg(frame.args["edo"], 12)
 
   -- optional number of columns, default: 8
   -- optional number of columns, default: 8
   local columns = eval_num_arg(frame.args["columns"], 8)
   local columns = eval_num_arg(frame.args["columns"], 8)
 
   -- optional start column, default: start with prime 2
   -- optional start column, default: start with prime 2
   local start = eval_num_arg(frame.args["start"], 1)
   local start = eval_num_arg(frame.args["start"], 1)
   local title = frame.args["title"] or "Approximation of prime intervals in " .. edo .. " EDO"
   local title = frame.args["title"] or "Approximation of prime intervals in " .. edo .. " EDO"
 
   -- optional precision for abs error, default about 3 digits
   -- optional precision for abs error, default about 3 digits
   local prec = eval_num_arg(frame.args["prec"], prec_by_edo(edo))
   local prec = eval_num_arg(frame.args["prec"], prec_by_edo(edo))
 
   -- option to show fifthspan information, default: false
   -- option to show fifthspan information, default: false
   local fs = (frame.args["fs"] == 1) or (frame.args["fs"] == "1") or false
   local fs = (frame.args["fs"] == 1) or (frame.args["fs"] == "1") or false
   return edoprox( edo, {unpack(primes, start, start+columns-1)}, title, prec, fs)
    
  local result = edoprox( edo, {unpack(primes, start, start+columns-1)}, title, prec, fs)
 
  -- debugger option
  local debugg = yesno(frame.args["debug"])
  if debugg == true then
    result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
  end
 
  return frame:preprocess(result)
end
end


return p;
return p