
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
precise-number
Advanced tools
In pure javascript 1.1*1.1 === 1.2100000000000002 is true!
npm install precise-number --save
const N = require('precise-number');
N.add( n1, n2 [,n3...]) //alias N.plus
N.sub( n1, n2 ) //alias N.minus
N.multiply(n1, n2 [, n3 ...]) //alias N.mul, N.multi, N.productOf
N.divide(n1, n2) //alias N.div N.dividedBy
N.parse(number_string, decimal) //string to number with decimals
N(1).add(2).multi(3).valueOf() === 9
N(1).add(2).multi(3) + 0 === 9
N(1).add(2).multi(3) * 1 === 9
N(1).add(2).multi(3) !== 9
//add
N.add(1, 2) === 3
N.add(1, 2, 3, 4, 5, 6.1) === 21.1
N.add(1.11, 1.11) === 2.22
N.add('100,102.11', 1.111) === 100103.221
N.add(0.000001, 1.0000001) === 1.0000011
N.add(9.99, -2.11) === 7.88
//minus
N.sub(1,2), -1);
N.sub(1.11,1.11), 0);
N.sub('100,102.11',1.111), 100100.999);
//multiply
N.multi(1,2) === 2
N.multi(1.11,1.11) === 1.2321
N.multi('100,102.11', 1.11) === 111113.3421
//division
N.div(1, 2) === 0.5
N.div(1.11, 1.11) === 1
N.div(1, 3) === 0.3333333333333333
N.div('100,102.11', 2) === 50051.055
//chain
N(1).multi(8.2).add(0.8).div(3) * 1 === 3
N.div(0.000000000123, 0.0000000001) === 1.23
N(1.23e-10).toString() === '0.000000000123'
N(1e+22).toString() === '10000000000000000000000'
FAQs
perform plus, minus, multiply and division algorithms precisely.
The npm package precise-number receives a total of 2 weekly downloads. As such, precise-number popularity was classified as not popular.
We found that precise-number demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.