 <p>I have the same result on my android device which means your device or computer works with 64 bits floating point representation. For correct result, you must limit displaying your result to 15 digits. I found this workaround : running : </p> <pre><code>var res = 1 - 0.8; var roundedRes = parseFloat(res.toPrecision(15) ) ; alert ("res="+res+"\n" + "roundedRes="+roundedRes); </code></pre> <p>ouputs : res=0.19999999999999996 roundedRes=0.2</p>