precise-math
v1.0.0
Published
Perform precise math operations without floating point errors.
Downloads
44
Maintainers
Readme
precise-math
Perform precise math operations without floating point errors.
Install
npm install precise-math
Usage
const { add } = require("precise-math")
console.log(0.2 + 0.1 + 0.05)
//=> 0.35000000000000003
console.log(add(0.2, 0.1, 0.05))
//=> 0.35
API
add(...numbers)
subtract(...numbers)
multiply(...numbers)
divide(...numbers)
modulo(...numbers)
numbers
Type: numbers
The numbers to perform the math operation on.