In the following example, when 0.3 is added with 0.6 the result must be 0.9 but since there are rounding errors the resulted value is not the intended value as shown in the output.
<html> <body> <p id="F-P-A"></p> <script> var err = 0.3 + 0.6; document.getElementById("F-P-A").innerHTML = "0.3 + 0.6 = " + err; </script> </body> </html>
0.3 + 0.6 = 0.8999999999999999
In the following example, when 0.2 and 0.1 were added the intended result is 0.3 but because of rounding error, the intended value is not the resulted value.
<html> <body> <p id="F-P-A"></p> <script> var err = 0.2 + 0.1; document.getElementById("F-P-A").innerHTML = "0.2 + 0.1 = " + err; </script> </body> </html>
0.2 + 0.1 = 0.30000000000000004