var a=0.01;
var b = 0.02;
console.log(a+b);
var c=0.1;
var d = 0.2;
console.log(c+d);
var a=0.01;
var b = 0.02;
console.log(a+b);
var c=0.1;
var d = 0.2;
console.log(c+d);
=>0.03
=>0.30000000000000004
0.01和0.02相加得到0.03,而0.1和0.2相加得到0.30000000000000004,在这种情况下javascript引擎的工作原理。