MikeMcl / big.js

A small, fast JavaScript library for arbitrary-precision decimal arithmetic.

Home Page:http://mikemcl.github.io/big.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Comparision operators

paritosh64ce opened this issue · comments

Can we have comparison operators (greaterThan, lessThan) support?

This library is definitely better alternative as compared to decimals.js as it supports more decimal precision except this one thing: comparedTo operator

I don't know know what you mean by "supports more precision".

Anyway, there is a cmp method, if that is what you are looking for.

It helps, thanks!

BTW, what I meant is this: while doing simple addition and subtraction, with big.js, I get more precise values of the result. Have a look at below screenshots (I used object.toPrecision(50) method).

With big.js
image

With decimal.js
image