inequality-arbitrary-precision
v1.0.1
Published
inequality operations abstraction to extend core-arbitrary-precision
Downloads
70
Maintainers
Readme
inequality-arbitrary-precision
Inequality operations abstraction to extend core-arbitrary-precision
Install
npm i inequality-arbitrary-precision
Adapters
Usage
var adapter = require('floating-adapter');
var inequalityEnhancer = require('inequality-arbitrary-precision');
var Decimal = inequalityEnhancer(require('core-arbitrary-precision')(adapter));
new Decimal('12').gt(new Decimal('5')); // => true
new Decimal('12').lt(new Decimal('5')); // => false
Operations: gt
, gte
, lt
, lte
, cmp
(-1, 0, 1).
Individual extenders can be applied as inequalityEnhancer.lt(Decimal)
;
See spec.