title: Accuracy of double Objective-C
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1089018/why-cant-decimal-numbers-be-represented-exactly-in-binary">Why can&#39;t decimal numbers be represented exactly in binary?</a>  </p>
  </blockquote>
  
  
  
  <p>When I enter 0.1 as a double value the compiler is adding a tiny value on the end of it that is causing other calculations to go wrong in the program that I am running. My code simply says:</p>
  
  <pre><code>double temp = 0.1;
  </code></pre>
  
  <p>And I get this in variable viewer:
  <a href="http://img.skitch.com/20111122-nnrcgi4dtteg8aa3e8926r3fd4.jpg" rel="nofollow noreferrer">http://img.skitch.com/20111122-nnrcgi4dtteg8aa3e8926r3fd4.jpg</a></p>
  
  <p>Does anyone know why this is happening?</p>
  
  <p>Thanks</p>