js中的数字是以二进制浮点数表示的,所以某些十进制小数在二进制下精度不准确。解决办法如下:1、使用误差范围,Number.EPSILON方法。2、toFixed方法3、Number.toPrecision方法