@bashrc/bigdecimal
v1.0.0
Published
BigDecimal provides arbitrary-precision signed decimal numbers.
Downloads
1
Readme
BigDecimal
BigDecimal.js provides arbitrary-precision signed decimal numbers.
Usage
Install using NPM
$ npm i --save @bashrc/bigdecimal
Import
import BigDecimal from "@bashrc/bigdecimal"
BigDecimal provides basic arithmetic operation like, plus, minus, multiply, and divide
plus
// 0.1 + 0.1 + 0.1
let num = new BigDecimal(0.1).plus(0.1).plus(0.1)
minus
// 0.3 - 0.1
let num = new BigDecimal(0.3).minus(0.1)
multiply
// 0.2 * 0.1
let num = new BigDecimal(0.2).multiply(0.1)
divide
// 0.3 / 0.1
let num = new BigDecimal(0.3).divide(0.1)