0

i have this javascript code :

var a = 0.1
var b = 0.7
var c = 0.8
console.log(a + b);
if (a + b == c) console.log("OK")

does not give the result as it should

the output is 0.7999999999999999 instead of 0.8 and never comes to the if statement

what is the problem here?

OAH
  • 1,160
  • 2
  • 11
  • 24

0 Answers0