
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.
@abw/badger-maths
Advanced tools
This library implements some basic mathematical functions that work around the imprecision in the IEEE 754 standard which Javascript uses for floating point numbers.
This library implements some basic mathematical functions that work around the imprecision in the IEEE 754 standard which Javascript uses for floating point numbers.
They were originally written using a fixed floating point algorithm based on the code in Sinful.js.
They are now implemented as Typescript wrappers around big.js.
Install badger-maths using your favourite package manager.
npm add @abw/badger-maths
pnpm add @abw/badger-maths
yarn add @abw/badger-maths
Import the add, subtract, multiply and/or divide functions from
@abw/badger-maths.
import { add, subtract, multiply, divide } from '@abw/badger-maths'
Then use them to add, subtract, multiple or divide two or more numbers.
add(1.1, 6.6, 0.1); // 1.1 + 6.6 + 0.1 => 7.8
subtract(7.8, 0.1, 2.4); // 7.8 - 0.1 - 2.4 => 5.3
multiply(3.0, 2.2, 2.0); // 3.0 * 2.2 * 2.0 => 13.2
divide(13.2, 2.0, 1.1); // 13.2 / 2.0 / 1.1 => 6
Visit the website for detailed documentation.
Andy Wardley abw@wardley.org
FAQs
This library implements some basic mathematical functions that work around the imprecision in the IEEE 754 standard which Javascript uses for floating point numbers.
We found that @abw/badger-maths 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.