获得徽章 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
也可以使用:
[math.js](
math.js的demo:
console.log(0.1 + 0.2 === 0.3) // false
console.log(math.equal(0.1 + 0.2, 0.3)) // true
展开
2
19
赞了这篇沸点
赞了这篇文章
赞了这篇文章