Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>Floating point arithmetic is not always 100% accurate.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = 0.2 + 0.1;
    document.getElementById("demo").innerHTML = "0.2 + 0.1 = " + x;
}
</script>

</body>
</html>




Result:
Try it Yourself - © w3schools.com
Privacy Policy