title: Algorithm for max and min? (Objective-C)
body: <p>This is a part of a book I'm reading to learn Objective-C.</p>
  
  <blockquote>
    <p>The following defines a macro called MAX that gives the maximum of two
    values: <code>#define MAX(a,b) ( ((a) &gt; (b)) ? (a) : (b) )</code></p>
  </blockquote>
  
  <p>And then there are some exercises in the book that asks the reader to define a macro (<code>MIN</code>) to find the minimum of two values and another that asks to define a macro called <code>MAX3</code> that gives the maximum of 3 values. I think these two definitions will look similar to <code>MAX</code>, but I don't understand how the <code>MAX</code>formula finds the maximum value. I mean if I just did this</p>
  
  <pre><code>int limits = MAX (4,8)
  </code></pre>
  
  <p>It'll just assign <code>limits</code> the value of 8. What does that have to do with finding a variable's maximum value?</p>