js计算精度问题(浮点数偏差,大数计算出错)

https://github.com/camsong/blog/issues/9javascript

0.1+0.2   //0.30000000000000004
1-0.9     //0.09999999999999998
9007199254740993-9007199254740992  //0
Math.pow(2,1023) //8.98846567431158e+307   
//可是
Math.pow(2,1024)  //Infinity
相关文章
相关标签/搜索