precise-math
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

precise-math Travis CI Build Status

Perform precise math operations without floating point errors.

NPM Badge

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.

Package Sidebar

Install

npm i precise-math

Weekly Downloads

31

Version

1.0.0

License

MIT

Unpacked Size

3.7 kB

Total Files

6

Last publish

Collaborators

  • richienb