Module:Primes in edo fs: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m +Debugging option
Line 108: Line 108:
   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 = "|-"..border_style.."\n" .. table.concat(tabs, "\n|") .. "\n"
   local data_rows = "|-"..border_style.."\n" .. table.concat(tabs, "\n|") .. "\n"
Line 153: Line 153:
   -- 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 out_str = edoprox( edo, {unpack(primes, start, start+columns-1)}, title, prec, fs)
  local debugg = frame.args["debug"]
  return frame:preprocess(debugg == "true" and "<pre>" .. out_str .. "</pre>" or out_str)
end
end


return p;
return p;