This site is supported by donations to The OEIS Foundation.

Template:MIN

From OeisWiki
Jump to: navigation, search

The {{MIN}} mathematical function template gives the minimum of one to eighty-one numbers or mathematical expressions. (For up to three arguments, please use {{min}} instead.)

Usage

{{MIN|expression}} (trivial case)
(...)
{{MIN|expression 1|...|expression 81}}

Valid input

One to eighty-one numbers or mathematical expressions as arguments.

Examples

Examples with valid input

Code Result
{{MIN|-34}} -34
{{MIN|34|-3}} -3
{{MIN|5*6|5^2|3^3}} 25
{{MIN|-34|-3}} -34
{{MIN|7|2|15}} 2
{{MIN|2|-7|-15}} -15
{{MIN|-7|2|-15}} -15
{{MIN|2|-15|-7}} -15
{{MIN|-7|-15|2}} -15
{{MIN|-15|2|-7}} -15
{{MIN|-15|-7|2}} -15
{{MIN|7|2|15|40}} 2
{{MIN|10^2|{{Fibonacci|11}}|97}} 89
{{MIN|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|77836|53565|-2}} -74
{{MIN|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75}} -74
{{MIN|7|2|15|56|90|34|-65|-8|78|878|-74}} -74
{{MIN|7|2|15|56|90|34|-65|-8|78|878}} -65

{{MIN|7|2|15|56|90|34|-65|-8|78|878|-74|867|564|75|-67|77836|53565|-2|837|873}} yields

-74

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

-84

{{MIN|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}} yields

-84

{{MIN|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}} yields

-84

{{MIN|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|-1683}} yields

-1683
{{MIN|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|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|63}}

yields

-84
{{MIN
|   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
|   3|   0|   35|   56|  90|  34| -65|  -8|  67| 878| -74| 367| 564|  75| -62| -789|53565|   -2|  837|  873|-2884| 2874|  287| 4289|   93| 9927|-7771
}}

yields

-2884
{{MIN
|   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
|   3|   0|   35|   56|  90|  34| -65|  -8|  67| 878| -74| 367| 564|  75| -62| -789|53565|   -2|  837|  873|-2884| 2874|  287| 4289|   93| 9927|-7771
|3645|   0| 2335| -756|-890|  34| -65|  98| 467|-878|-653| 267|1564|  75| -62| -789|-9567| -112| 8237|  873|-2884| 2874|  287|14289|  -93| 9927|-2231
}}

yields

-2884

Examples with invalid input

Code Result
{{MIN}} MIN error: One to eighty-one unformatted numbers required as arguments
{{MIN|}} MIN error: One to eighty-one unformatted numbers required as arguments
{{MIN|one}} MIN error: One to eighty-one unformatted numbers required as arguments
{{MIN|34|-3 blobs}} Expression error: Unexpected < operator.
{{MIN|34|blobs}} Expression error: Unexpected < operator.
{{MIN|7|blob|15}} Expression error: Unexpected < operator.
{{MIN|7|15|blob}} Expression error: Unexpected < operator.
{{MIN|34|-3,000}} Expression error: Unexpected < operator.

{{MIN}} yields

MIN error: One to eighty-one unformatted numbers required as arguments

{{MIN|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|63}} yields

Expression error: Unexpected < operator.

{{MIN|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 (formatted numbers not allowed)

Expression error: Unexpected < operator.
{{MIN
|   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
|   3|   0|   35|   56|  90|  34| -65|  -8|  67| 878| -74| 367| 564|  75| -62| -789|53565|   -2|  837|  873|-2884| 2874|  287| 4289|   93| 9927|-7771
|3645|   0| 2335| -756|-890|  34| -65|  -8|  67| 878|-653| 367| 564|  75| -62| -789|-9565|   -2|  837|  873|-2884| 2874|  287| 4289|   93| 9927|-7771
|  34
}}

yields

MIN error: Too many arguments (one to eighty-one unformatted numbers required as arguments)

Code

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

This function uses the core functions 

* {{tlxb|~Min3}}, {{tlxb|~Min9}}, {{tlxb|~Min27}}, {{tlxb|~Min81}}

-->{{#if: {{{82|}}}
| {{error| MIN error: Too many arguments (one to eighty-one [[unformatted numbers]] required as arguments) }}
| {{ifnum| {{{1}}}
  | {{#if: {{{4|}}}
    | {{#if: {{{10|}}}
      | {{#if: {{{28|}}}
        | {{~Min81 
          |  {{{1|}}} |  {{{2|}}} |  {{{3|}}} |  {{{4|}}} |  {{{5|}}} |  {{{6|}}} |  {{{7|}}} |  {{{8|}}} |  {{{9|}}}
          | {{{10|}}} | {{{11|}}} | {{{12|}}} | {{{13|}}} | {{{14|}}} | {{{15|}}} | {{{16|}}} | {{{17|}}} | {{{18|}}}
          | {{{19|}}} | {{{20|}}} | {{{21|}}} | {{{22|}}} | {{{23|}}} | {{{24|}}} | {{{25|}}} | {{{26|}}} | {{{27|}}}
          | {{{28|}}} | {{{29|}}} | {{{30|}}} | {{{31|}}} | {{{32|}}} | {{{33|}}} | {{{34|}}} | {{{35|}}} | {{{36|}}}
          | {{{37|}}} | {{{38|}}} | {{{39|}}} | {{{40|}}} | {{{41|}}} | {{{42|}}} | {{{43|}}} | {{{44|}}} | {{{45|}}}
          | {{{46|}}} | {{{47|}}} | {{{48|}}} | {{{49|}}} | {{{50|}}} | {{{51|}}} | {{{52|}}} | {{{53|}}} | {{{54|}}}
          | {{{55|}}} | {{{56|}}} | {{{57|}}} | {{{58|}}} | {{{59|}}} | {{{60|}}} | {{{61|}}} | {{{62|}}} | {{{63|}}}
          | {{{64|}}} | {{{65|}}} | {{{66|}}} | {{{67|}}} | {{{68|}}} | {{{69|}}} | {{{70|}}} | {{{71|}}} | {{{72|}}}
          | {{{73|}}} | {{{74|}}} | {{{75|}}} | {{{76|}}} | {{{77|}}} | {{{78|}}} | {{{79|}}} | {{{80|}}} | {{{81|}}}
          }}
        | {{~Min27
          |  {{{1|}}} |  {{{2|}}} |  {{{3|}}} |  {{{4|}}} |  {{{5|}}} |  {{{6|}}} |  {{{7|}}} |  {{{8|}}} |  {{{9|}}}
          | {{{10|}}} | {{{11|}}} | {{{12|}}} | {{{13|}}} | {{{14|}}} | {{{15|}}} | {{{16|}}} | {{{17|}}} | {{{18|}}}
          | {{{19|}}} | {{{20|}}} | {{{21|}}} | {{{22|}}} | {{{23|}}} | {{{24|}}} | {{{25|}}} | {{{26|}}} | {{{27|}}}
          }}
        }}
      | {{~Min9
        |  {{{1|}}} |  {{{2|}}} |  {{{3|}}} |  {{{4|}}} |  {{{5|}}} |  {{{6|}}} |  {{{7|}}} |  {{{8|}}} |  {{{9|}}}
        }}
      }}
    | {{~Min3
      | {{{1|}}} | {{{2|}}} | {{{3|}}}
      }}  
    }} 
  | {{error| MIN error: One to eighty-one [[unformatted numbers]] required as arguments }}
  }}
}}</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)