JavaScript numerical values slightly off
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/588004/is-javascripts-math-broken">Is JavaScript’s Math broken?</a>  </p>
</blockquote>



<p>So I'm writing a program that calculates numbers to very precise values, and I learned the hard way that numerical values are never exactly as they seem. For example:</p>

<pre><code>&lt;script type="text/javascript"&gt;
var num=80.902
var difference=(num*10-Math.floor(num*10))/10;
document.write(difference);
&lt;/script&gt;
</code></pre>

<p>This shows that there is an actual difference of 0.001999999999998181. Is there any way to go about making these numbers exact? I'm guessing it's some sort of memory thing, so is there a way I'm supposed to make it into a double or something? It's annoying having to compare data to a number smaller than 10^-13.</p>
