js-np:js浮点精度

时间:2021-04-08 19:09:46
【文件属性】:
文件名称:js-np:js浮点精度
文件大小:64KB
文件格式:ZIP
更新时间:2021-04-08 19:09:46
JavaScript js-np 使用javascript精确执行加,减,乘和除运算 为什么 0.1 + 0.2 = 0.30000000000000004 1.0 - 0.9 = 0.09999999999999998 0.105 . toFixed ( 2 ) = 0.1 // not 0.11 安装 npm install number-precision --save 方法 NP . strip ( num ) // strip a number to nearest right number NP . plus ( num1 , num2 , num3 , ... ) // addition, num + num2 + num3, two numbers is required at least. NP . minus ( num1 , num2 , num3 , ... )
【文件预览】:
js-np-master
----.travis.yml(166B)
----rollup.config.js(448B)
----package.json(1KB)
----tslint.json(865B)
----test()
--------index.test.ts(10KB)
----LICENSE(1KB)
----src()
--------index.ts(4KB)
----tsconfig.test.json(316B)
----.npmignore(39B)
----tsconfig.json(346B)
----.gitignore(69B)
----CHANGELOG.md(353B)
----README.md(1KB)
----yarn.lock(137KB)
----build()
--------index.js(6KB)
--------index.umd.js(6KB)
--------index.js.map(4KB)
--------index.es.js(6KB)
--------index.iife.js(6KB)

网友评论