Skip to content

Commit

Permalink
feat: add mod operation
Browse files Browse the repository at this point in the history
  • Loading branch information
javiercejudo committed Nov 10, 2015
1 parent b109910 commit baf1b11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
1 change: 1 addition & 0 deletions src/linear-arbitrary-precision.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
);

Expand Down
4 changes: 4 additions & 0 deletions test/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit baf1b11

Please sign in to comment.