diff --git a/package.json b/package.json index c1ab1ba..176dd77 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "equals-arbitrary-precision": "^1.0.1", "lodash.flow": "^3.2.1", "minus-arbitrary-precision": "^1.0.0", + "mod-arbitrary-precision": "^1.0.0", "plus-arbitrary-precision": "^1.0.0", "times-arbitrary-precision": "^1.0.0" } diff --git a/src/linear-arbitrary-precision.js b/src/linear-arbitrary-precision.js index 10ac917..698828d 100644 --- a/src/linear-arbitrary-precision.js +++ b/src/linear-arbitrary-precision.js @@ -10,6 +10,7 @@ var extend = flow( require('minus-arbitrary-precision'), require('times-arbitrary-precision'), require('div-arbitrary-precision'), + require('mod-arbitrary-precision'), require('equals-arbitrary-precision') ); diff --git a/test/spec.js b/test/spec.js index ba57a1f..47de9fe 100644 --- a/test/spec.js +++ b/test/spec.js @@ -62,6 +62,10 @@ describe('linear operations with Floating', function() { new Decimal('0.3').div(new Decimal('0.2')).valueOf().should.be.exactly(0.3 / 0.2); }); + it('should have a div method', function() { + new Decimal('12').mod(new Decimal('5')).valueOf().should.be.exactly(2); + }); + it('should have an equals method', function() { new Decimal('1').equals(new Decimal('1')).should.be.exactly(true); new Decimal('1').equals(new Decimal('2')).should.be.exactly(false);