This site is supported by donations to The OEIS Foundation.

Template:~Max27

From OeisWiki
Jump to: navigation, search

The {{~Max27}} core function template (used by the {{MAX}} mathematical function template) gives the maximum of one to twenty-seven numbers or mathematical expressions, but should be used for ten to twenty-seven numbers or mathematical expressions, whereas {{~Max9}} should be used for four to nine numbers or mathematical expressions. This template

  • considers only the first twenty-seven arguments (ignores extra arguments);
  • considers only arguments (among the first twenty-seven) which are not undefined, empty string or white space characters (spaces, tabs, newlines) only;
  • returns empty string if all twenty-seven 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

{{~Max27|expression 1|(at least up to expression 10 is recommended)|expression 10|...|expression 27}}

Valid input

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

Examples

Examples with valid arguments

{{~Max27}} yields

(the empty string was returned)

{{~Max27|7|2|15|56|90|34|-65}} yields

90

{{~Max27|7+1|2+1|15+1|56|90+1|34+1|-65+1|-8+1|78|878+1|-74+1|867+1|564+1|75+1|-67+1|77836+1|53565-125888|-2+1|837|873|-84|2874|287|4289|93|9927|-2731}} yields

77837

{{~Max27|7|2|15|56|90|-2731|34|-65|-8|78|878|-74|867|564|75|-67|77836|53565|-2|837|873|-84|2874|287|4289|93|9927}} yields

77836

{{~Max27|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|77836|53565|-2|837|873|-84|2874|287|4289|93|9927|-2731}} yields

77836

{{~Max27|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|77836||-2|837|873|-84|2874|287|-2731|84289|93|9927}} yields

84289 (note that the 17 th argument is empty)

{{~Max27|7|2|15|56|90|34|-65|{{formatnum:2,000|R}}|78}} yields

2000 (remove format from formatted numbers)

Examples with invalid arguments

{{~Max27|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|77836|53565|-2|837|873|-84|2874|287|4289|93|9927|63|92731}} yields

77836 (the 28 th argument is ignored!)

{{~Max27|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|oops|837|873|-84|2874|287|4289|93|9927|-2731|63}} yields

Expression error: Unexpected < operator.

{{~Max27|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|2,000|837|873|-84|2874|287|4289|93|9927|-2731|63}} yields

Expression error: Unexpected < operator. (formatted numbers are not allowed!)

Code


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

  Should be used for ten to twenty-seven numbers or mathematical expressions

-->{{~Max3
  |                    {{~Max9|  {{{1|}}} |  {{{2|}}} |  {{{3|}}} |  {{{4|}}} |  {{{5|}}} |  {{{6|}}} |  {{{7|}}} |  {{{8|}}} |  {{{9|}}} }}
  | {{#if: {{{10|}}} | {{~Max9| {{{10|}}} | {{{11|}}} | {{{12|}}} | {{{13|}}} | {{{14|}}} | {{{15|}}} | {{{16|}}} | {{{17|}}} | {{{18|}}} }} }} 
  | {{#if: {{{19|}}} | {{~Max9| {{{19|}}} | {{{20|}}} | {{{21|}}} | {{{22|}}} | {{{23|}}} | {{{24|}}} | {{{25|}}} | {{{26|}}} | {{{27|}}} }} }}
}}</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)