Open zhuanghaixin opened 2 years ago
0.1+0.2==0.3 // false
如何使得0.1+0.2==0.3 为true
x = 0.2; y = 0.3; z = 0.1; equal = (Math.abs(x - y + z) < Number.EPSILON);
if (Number.EPSILON === undefined) { Number.EPSILON = Math.pow(2, -52); }
如何使得0.1+0.2==0.3 为true