Difference between revisions of "Template:Max"
Jump to navigation
Jump to search
imported>Verdy p m |
imported>Verdy p m |
||
| Line 1: | Line 1: | ||
<includeonly>{{#if:{{{1|}}}|{{#expr: | <includeonly>{{#if:{{{1|}}}|{{#expr: | ||
{{#if:{{{2|}}}| | {{#if:{{{2|}}}| | ||
| − | {{#if:{{{3|}}}|{{ | + | {{#if:{{{3|}}}| |
| − | |{{#ifexpr:({{{1}}})>({{{2}}})|{{{1}}}|{{{2}}}}} | + | {{#ifexpr:({{{1}}})>({{{2}}}) |
| + | | {{#ifexpr:({{{1}}})>({{{3}}})|{{{1}}}|{{{3}}}}} | ||
| + | | {{#ifexpr:({{{2}}})>({{{3}}})|{{{2}}}|{{{3}}}}} | ||
| + | }} | ||
| + | | {{#ifexpr:({{{1}}})>({{{2}}})|{{{1}}}|{{{2}}}}} | ||
}} | }} | ||
|{{{1}}} | |{{{1}}} | ||
}} | }} | ||
}}|}}</includeonly><noinclude> | }}|}}</includeonly><noinclude> | ||
| − | Evaluates and returns the maximum of a list of numeric expressions (with up to | + | Evaluates and returns the maximum of a list of numeric expressions (with up to 3 parameters). |
; Syntax<nowiki>:</nowiki> | ; Syntax<nowiki>:</nowiki> | ||
; Examples<nowiki>:</nowiki> | ; Examples<nowiki>:</nowiki> | ||
| Line 17: | Line 21: | ||
: <tt><nowiki>{{max|-7|5|}}</nowiki></tt> = "{{max|-7|5|}}". | : <tt><nowiki>{{max|-7|5|}}</nowiki></tt> = "{{max|-7|5|}}". | ||
: <tt><nowiki>{{max|-7|5|8}}</nowiki></tt> = "{{max|-7|5|8}}". | : <tt><nowiki>{{max|-7|5|8}}</nowiki></tt> = "{{max|-7|5|8}}". | ||
| − | |||
: <tt><nowiki>{{max|40*41|300+30}}</nowiki></tt> = "{{max|40*41|300+30}}". | : <tt><nowiki>{{max|40*41|300+30}}</nowiki></tt> = "{{max|40*41|300+30}}". | ||
: <tt><nowiki>{{max|100+10|300+30|200+20}}</nowiki></tt> = "{{max|100+10|300+30|200+20}}". | : <tt><nowiki>{{max|100+10|300+30|200+20}}</nowiki></tt> = "{{max|100+10|300+30|200+20}}". | ||
| Line 23: | Line 26: | ||
[[Category:Templates using ParserFunctions]] | [[Category:Templates using ParserFunctions]] | ||
[[Category:Mathematical templates]] | [[Category:Mathematical templates]] | ||
| − | |||
| − | |||
| − | |||
</noinclude> | </noinclude> | ||
Revision as of 15:35, 24 April 2006
Evaluates and returns the maximum of a list of numeric expressions (with up to 3 parameters).
- Syntax:
- Examples:
- {{max}} = "".
- {{max|}} = "".
- {{max|-7}} = "-7".
- {{max|-7|}} = "-7".
- {{max|-7|5}} = "5".
- {{max|-7|5|}} = "5".
- {{max|-7|5|8}} = "8".
- {{max|40*41|300+30}} = "1640".
- {{max|100+10|300+30|200+20}} = "330".