获得徽章 0
赞了这篇沸点
0.1+0.2==0.3 可以使用Math.abs(0.1+0.2-0.3)<=Number.EPSILON解决,
也可以使用:
[math.js](mathjs.org网页链接网页链接网页链接)库解决
math.js的demo:
console.log(0.1 + 0.2 === 0.3) // false
console.log(math.equal(0.1 + 0.2, 0.3)) // true
展开
2
赞了这篇沸点
加油!一直在路上!
EdwardXuan于2019-03-07 16:50发布的图片
评论