Inequality operations abstraction to extend core-arbitrary-precision
npm i inequality-arbitrary-precision
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.