js精确计算

官方文档:http://mikemcl.github.io/big.js/

使用方法:

x = new Big(0.1);

y = x.plus(0.2); // '0.3'

var a=Big(0.7).plus(x).plus(y);

console.log(a.toString());

//a 是一个big对象,通过toString()方法转化成字符串

结果是1.1

博客地址:http://www.cnblogs.com/windseek/

posted on 2016-10-08 16:45  杨龙飞  阅读(522)  评论(0编辑  收藏  举报

导航

Fork me on GitHub