JavaScript 0.3-0.2!=0.2-0.1

原因:JS中所有的浮点数都不能精确表示

解决方案:tofixed()

猜你喜欢

转载自blog.csdn.net/ferrysoul/article/details/81501909