title: Objective-C Integer Arithmetic
body: <p>I'm trying to calculate some numbers in an iPhone application.</p>
  
  <pre><code>int i = 12;
  int o = (60 / (i * 50)) * 1000;
  </code></pre>
  
  <p>I would expect o to be 100 (that's milliseconds) in this example but it equals 0 as displayed by NSLog(@"%d", o).</p>
  
  <p>This also equals 0.</p>
  
  <pre><code>int o = 60 / (i * 50) * 1000;
  </code></pre>
  
  <p>This equals 250,000, which is straight left-to-right math.</p>
  
  <pre><code>int o = 60 / i * 50 * 1000;
  </code></pre>
  
  <p>What's flying over my head here?</p>
  
  <p>Thanks,<br>
  Nick</p>