This site is supported by donations to The OEIS Foundation.

Template:~Max9

From OeisWiki
Jump to: navigation, search

The {{~Max9}} core function template (used by the {{MAX}} mathematical function template) gives the maximum of one to nine numbers or mathematical expressions, but should be used for four to nine numbers or mathematical expressions, where {{~Max3}} should be used for one to three numbers or mathematical expressions. This template

  • considers only the first nine arguments (ignores extra arguments);
  • considers only arguments (among the first nine) which are not undefined, empty string or white space characters (spaces, tabs, newlines) only;
  • returns empty string if all nine arguments are undefined, empty string or white space characters (spaces, tabs, newlines) only;
  • returns an error message when a considered argument does not evaluate to a number (arguments require prior validation).

Usage

{{~Max9|expression 1|expression 2|expression 3|expression 4}}
(...)
{{~Max9|expression 1|expression 2|expression 3|expression 4|expression 5|expression 6|expression 7|expression 8|expression 9}}

Valid input

One to nine expressions yielding numbers (requires prior validation) as arguments. Extra arguments are ignored! Arguments (among the first nine) which are undefined, empty string or white space characters (spaces, tabs, newlines) only are ignored.

Examples

Examples with valid arguments

Code Result Comment
{{~Max9}} (empty string)
{{~Max9|7+1}} 8
{{~Max9|7+1|2+1|15+1}} 16
{{~Max9|7|2|15|56|90|34|-65|-8|78}} 90
{{~Max9|7|2|15|56|90|34|-8|78}} 90
{{~Max9|7|2|15|56||90|34|-8|78}} 90 (fifth argument is empty)
{{~Max9|7|2|15|56|90|34|78}} 90
{{~Max9|7|15|56|90|34|78}} 90
{{~Max9|15|56|90|34|78}} 90
{{~Max9|56|90|34|78}} 90
{{~Max9|7+1|2+1|15+1|56+1|90+1|34+1|-65+1|-8+1|78+1}} 91
{{~Max9|7|2|15|56|90|34|-65|{{formatnum:2,000|R}}|78}} 2000 (remove format from formatted numbers)

Examples with invalid arguments

Code Result Comment
{{~Max9|7|2|15|56|90|34|-65|2,000|78}} Expression error: Unexpected < operator. (can't use formatted numbers)
{{~Max9|7|2|15|56|90|34|-65|oops|78}} Expression error: Unexpected < operator.
{{~Max9|7|2|15|56|90|34|-65|-8|78|167}} 90 (tenth argument ignored!)

Code


<noinclude>{{Documentation}}</noinclude><includeonly><!--

  Should be used for four to nine numbers or mathematical expressions

-->{{~Max3
| {{~Max3| {{{1|}}} | {{{2|}}} | {{{3|}}} }} 
| {{~Max3| {{{4|}}} | {{{5|}}} | {{{6|}}} }}
| {{~Max3| {{{7|}}} | {{{8|}}} | {{{9|}}} }}
}}</includeonly>

See also

  • {{min}} minimum of one to three expressions yielding numbers
  • {{max}} maximum of one to three expressions yielding numbers


  • {{MIN}} minimum of one to eighty-one expressions yielding numbers
  • {{MAX}} maximum of one to eighty-one expressions yielding numbers


  • Core function templates (used ONLY by {{MIN}}; do NOT use directly!)
    • {{~Min3}} (should be used for up to three numbers or mathematical expressions)
    • {{~Min9}} (should be used for four to nine numbers or mathematical expressions)
    • {{~Min27}} (should be used for ten to twenty-seven numbers or mathematical expressions)
    • {{~Min81}} (should be used for twenty-eight to eighty-one numbers or mathematical expressions)


  • Core function templates (used ONLY by {{MAX}}; do NOT use directly!)
    • {{~Max3}} (should be used for up to three numbers or mathematical expressions)
    • {{~Max9}} (should be used for four to nine numbers or mathematical expressions)
    • {{~Max27}} (should be used for ten to twenty-seven numbers or mathematical expressions)
    • {{~Max81}} (should be used for twenty-eight to eighty-one numbers or mathematical expressions)