title: Unexpected result converting double to int
body: <p>I was trying to cast a <code>double</code> value to <code>int</code> and I got a different value.</p>
  
  <p>I have this code:</p>
  
  <pre><code>double double100times = 240;
  int a=[[NSNumber numberWithDouble:double100times] intValue];
  </code></pre>
  
  <p>and the value I get from this is <code>a=239</code>.</p>
  
  <p>If I use <code>int a= (int)double100times</code> instead I get the same value.</p>
  
  <p>Why is this?</p>
  
  <p>UPDATE: If I use     double double100times = 240; works, 
  but I'm using:</p>
  
  <pre><code> double double100times = (2.3*100)+10;
  </code></pre>