Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:R"

From Prime-Wiki
Jump to: navigation, search
(new)
 
(finalized)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<noinclude>__NOTOC__
 
==Purpose==
 
==Purpose==
Templates to standardize the presenting ranges for using in history entries and other pages.
+
Template '''R''' to display a standardized '''r'''ange given.
  
==How to==
+
==Parameters==
General template <pre>{{R|<type>|<min>|<max>}}</pre>
+
*1st: character to choose the range parameter name like 'n' (for {{Vn}}-range), 'k' (for {{Vk}}-range) or any other character/word
*"R" is "range"
+
*2nd: start of range as number (including this number)
*<type>: {{Vk}}, {{Vn}} or others like {{V|b}} for base
+
*3rd: end of range as number (including this number)
*<min>, <max>: range '''including''' these values
 
Example: <pre>{{R|k|100|1000}}</pre> produces the ouput '''{{Vk}} = 100 - 1000''' (including spacings).
 
  
 +
==Notes==
 +
*If 'start' and 'end' are equal the output is given as: '''<1st param.> = <start>'''.
 +
*All three parameters have to be given, there's no errorhandling.
 +
*For most used ranges there're shorter templates for {{Vn}}- and {{Vk}}-ranges, see [[Template:Rn]] and [[Template:Rk]].
  
Special templates for often used {{Vk}}- and {{Vn}}-values:
+
==Examples==
*<nowiki>{{Rk|<min>|<max>}}</nowiki> for {{Vk}}-values
+
*<nowiki>{{R|n|1|1000}}</nowiki> gives {{R|n|1|1000}}
*<nowiki>{{Rn|<min>|<max>}}</nowiki> for {{Vn}}-values
+
*<nowiki>{{R|k|1000|1000}}</nowiki> gives {{R|k|1000|1000}}
calling internally the general template.
+
*<nowiki>{{R|Z|1|1}}</nowiki> gives {{R|Z|1|1}}
Example: <pre>{{Rk|100|1000}}</pre> produces the ouput '''{{Vk}} = 100 - 1000''' (including spacings).
+
*<nowiki>{{R|base|101|199}}</nowiki> gives {{R|base|101|199}}
 
+
[[Category:Templates]]</noinclude><includeonly>{{#ifeq:{{{2}}}|{{{3}}}|'''{{V|{{{1}}}}} = {{{2}}}'''|'''{{V|{{{1}}}}} = {{{2}}} - {{{3}}}'''}}</includeonly>
==Specification==
 
*Every call must contain <min> '''and''' <max> values (in purpose of text replacements and finding).
 
*If <min> equals <max> then only '''<type> = <min>''' will be displayed (example for [[:Category:Riesel prime const|constant {{Vn}}-range]] searches) .
 
*The smallest <min> is 1 but also have to be given.
 
*If <min> or <max> are unknown/unbound or not given by the user the values should be given as phrase: example <nowiki>{{Rn|various|unbound}}</nowiki> will be displayed as '''{{Vn}} = various - unbound'''.
 
:*allowed values: unknown, unbound, various,... {{C|red|Any others in mind?}}
 
*No other values (math symbols, html-type characters or unicode values) allowed.
 
:*Phrasings like "{{Vn}}<1000" has to be converted to "{{Vn}} = 1 - 999"
 
*All three new templates will be inserted in the 'Shortcuts' section at the bottom of the page when editing like for HistF- or Vn-templates.
 
 
 
[[Category:Help]]
 

Latest revision as of 13:15, 31 July 2024

Purpose

Template R to display a standardized range given.

Parameters

  • 1st: character to choose the range parameter name like 'n' (for n-range), 'k' (for k-range) or any other character/word
  • 2nd: start of range as number (including this number)
  • 3rd: end of range as number (including this number)

Notes

  • If 'start' and 'end' are equal the output is given as: <1st param.> = <start>.
  • All three parameters have to be given, there's no errorhandling.
  • For most used ranges there're shorter templates for n- and k-ranges, see Template:Rn and Template:Rk.

Examples

  • {{R|n|1|1000}} gives n = 1 - 1000
  • {{R|k|1000|1000}} gives k = 1000
  • {{R|Z|1|1}} gives Z = 1
  • {{R|base|101|199}} gives base = 101 - 199