1.0.0 • Published 4 years ago

precise-math v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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.