JS、TS最好用的定点数库
由于开发帧同步游戏需要用到定点数,这里推荐下JS开源的3款定点数库
1:big.js
体积最小,功能也最少,但对于一般的游戏来说都是够用了的
github地址:https://github.com/MikeMcl/big.js/
API: http://mikemcl.github.io/big.js/#big
2:decimal.js
体积稍大,功能很全,更多的方法,比bignumber.js 要更好点
github地址:https://github.com/MikeMcl/decimal.js
API: http://mikemcl.github.io/decimal.js/
3:bignumber.js
体积和decimal.js差不多,但还是有一点稍微的区别
github地址:https://github.com/MikeMcl/bignumber.js/
具体的差别就需要自己去看官方文档了