<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AMax</id>
	<title>TI-BASIC:Max - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AMax"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Max&amp;action=history"/>
	<updated>2026-04-29T23:00:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Max&amp;diff=946&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Max&amp;diff=946&amp;oldid=prev"/>
		<updated>2016-02-24T18:26:42Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:TI-BASIC:Command&lt;br /&gt;
|picture=MAX.GIF&lt;br /&gt;
|summary=Returns the maximum of two elements or of a list.&lt;br /&gt;
|syntax=* for two numbers: max(&amp;#039;&amp;#039;x&amp;#039;&amp;#039;,&amp;#039;&amp;#039;y&amp;#039;&amp;#039;)&lt;br /&gt;
* for a list: max(&amp;#039;&amp;#039;list&amp;#039;&amp;#039;)&lt;br /&gt;
* comparing a number to each element of a list: max(&amp;#039;&amp;#039;x&amp;#039;&amp;#039;,&amp;#039;&amp;#039;list&amp;#039;&amp;#039;) or max(&amp;#039;&amp;#039;list&amp;#039;&amp;#039;,&amp;#039;&amp;#039;x&amp;#039;&amp;#039;)&lt;br /&gt;
* pairwise comparing two lists: max(&amp;#039;&amp;#039;list1&amp;#039;&amp;#039;,&amp;#039;&amp;#039;list2&amp;#039;&amp;#039;)&lt;br /&gt;
|location=Press:&lt;br /&gt;
# MATH to access the [[TI-BASIC:Math|Math]] menu.&lt;br /&gt;
# RIGHT to access the NUM submenu.&lt;br /&gt;
# 7 to select max(, or use arrows.&lt;br /&gt;
&lt;br /&gt;
Alternatively, press:&lt;br /&gt;
# 2nd LIST to access the list menu.&lt;br /&gt;
# LEFT to access the MATH submenu.&lt;br /&gt;
# 2 to select max(, or use arrows.&lt;br /&gt;
|compatibility=TI-83/84/+/SE&lt;br /&gt;
|size=1 byte&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
max(&amp;#039;&amp;#039;x&amp;#039;&amp;#039;,&amp;#039;&amp;#039;y&amp;#039;&amp;#039;) returns the largest of the two numbers &amp;#039;&amp;#039;x&amp;#039;&amp;#039; and &amp;#039;&amp;#039;y&amp;#039;&amp;#039;. max(&amp;#039;&amp;#039;list&amp;#039;&amp;#039;) returns the largest element of &amp;#039;&amp;#039;list&amp;#039;&amp;#039;. max(&amp;#039;&amp;#039;list1&amp;#039;&amp;#039;,&amp;#039;&amp;#039;list2&amp;#039;&amp;#039;) returns the pairwise maxima of the two lists. max(&amp;#039;&amp;#039;list1&amp;#039;&amp;#039;,&amp;#039;&amp;#039;x&amp;#039;&amp;#039;) (equivalently, max(&amp;#039;&amp;#039;x&amp;#039;&amp;#039;,&amp;#039;&amp;#039;list1&amp;#039;&amp;#039;)) returns a list whose elements are the larger of &amp;#039;&amp;#039;x&amp;#039;&amp;#039; or the corresponding element of the original list.&lt;br /&gt;
&lt;br /&gt;
 max(2,3)&lt;br /&gt;
      3&lt;br /&gt;
 max({2,3,4})&lt;br /&gt;
      4&lt;br /&gt;
 max({1,3},{4,2})&lt;br /&gt;
      {4 3}&lt;br /&gt;
 max({1,3},2)&lt;br /&gt;
      {2 3}&lt;br /&gt;
&lt;br /&gt;
Unlike comparison operators such as &amp;lt; and &amp;gt;, max( can also compare complex numbers. To do this, both arguments must be complex -- either complex numbers or complex lists: max(2,&amp;#039;&amp;#039;i&amp;#039;&amp;#039;) will throw an error even though max(2+0&amp;#039;&amp;#039;i&amp;#039;&amp;#039;,&amp;#039;&amp;#039;i&amp;#039;&amp;#039;) won&amp;#039;t. In the case of complex numbers, the number with the largest absolute value will be returned. When the two numbers have the same absolute value, the first one will be returned: max(&amp;#039;&amp;#039;i&amp;#039;&amp;#039;,-&amp;#039;&amp;#039;i&amp;#039;&amp;#039;) returns &amp;#039;&amp;#039;i&amp;#039;&amp;#039; and max(-&amp;#039;&amp;#039;i&amp;#039;&amp;#039;,&amp;#039;&amp;#039;i&amp;#039;&amp;#039;) returns -&amp;#039;&amp;#039;i&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
max( can be used in Boolean comparisons to see if at least one of a list is 1 (true) -- useful because commands like [[TI-BASIC:If|If]] or [[TI-BASIC:While|While]] only deal with numbers, and not lists, but comparisons like L1=L2 return a list of values. In general, the behavior you want varies, and you will use the [[TI-BASIC:Min|Min(]] function or the max( function accordingly.&lt;br /&gt;
&lt;br /&gt;
Using max( will give you a lenient test -- if any one element of the list is 1 (true), then the max( of the list is true -- this is equivalent to putting an &amp;#039;or&amp;#039; in between every element. For example, this tests if K is equal to any of 24, 25, 26, or 34 (the [[TI-BASIC:Getkey|GetKey]] arrow key values):&lt;br /&gt;
&lt;br /&gt;
 :If max(K={24,25,26,34&lt;br /&gt;
 :Disp &amp;quot;ARROW KEY&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get the element of a real list with the greatest absolute value, use imag(max(iAns.&lt;br /&gt;
&lt;br /&gt;
= Error Conditions =&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#datatype|ERR:DATA TYPE]]&amp;#039;&amp;#039;&amp;#039; is thrown when comparing a real and a complex number. This can be avoided by adding +0&amp;#039;&amp;#039;i&amp;#039;&amp;#039; to the real number (or &amp;#039;&amp;#039;i^4&amp;#039;&amp;#039; right after it, for those who are familiar with complex numbers)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#dimmismatch|ERR:DIM MISMATCH]]&amp;#039;&amp;#039;&amp;#039; is thrown, when using max( with two lists, if they have different dimensions.&lt;br /&gt;
&lt;br /&gt;
= Related Commands =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Min|Min(]]&lt;br /&gt;
* [[TI-BASIC:Sum|Sum(]]&lt;br /&gt;
* [[TI-BASIC:Prod|Prod(]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>