Cannot understand how add operation works on decimal numbers in javascript
<p>I have always been coding in java and have recently started coding in javascript (node.js to be precise). One thing that's driving me crazy is add operation on decimal numbers;</p>

<p>Consider the following code</p>

<pre><code>var a=0.1, b=0.2, c=0.3;
var op1 = (a+b)+c;
var op2 = (b+c)+a;
</code></pre>

<p>To my amazement I find out <code>op1 != op2</code> ! console.logging op1 and op2 print out the following:</p>

<pre><code>console.log(op1); 0.6000000000000001
console.log(op2); 0.6
</code></pre>

<p>This does not make sense. This looks like a bug to me because javascript simply cannot ignore rules of arithmetic. Could someone please explain why this happens?</p>
