Possible Duplicate:
Is JavaScript’s Math broken?
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:
<script type="text/javascript">
var num=80.902
var difference=(num*10-Math.floor(num*10))/10;
document.write(difference);
</script>
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.