From 516dc774375793d55e292962ef937c1db8f82b10 Mon Sep 17 00:00:00 2001 From: Igor Losev Date: Thu, 7 Sep 2023 19:37:47 +0200 Subject: [PATCH] Release. Bump version number --- package.json | 2 +- test/SpecRunner.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ff89611..897184d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@barchart/common-js", - "version": "4.32.0", + "version": "4.33.0", "description": "Library of common JavaScript utilities", "author": { "name": "Bryan Ingle", diff --git a/test/SpecRunner.js b/test/SpecRunner.js index a2d0c52..01916f0 100644 --- a/test/SpecRunner.js +++ b/test/SpecRunner.js @@ -2913,6 +2913,18 @@ module.exports = (() => { return new Decimal(this._big.round(places, modeToUse.value)); } + /** + * Returns a new {@link Decimal} instance with a value that returns + * the remainder of dividing by the value supplied. + * + * @public + * @param {Decimal|Number|String} other + * @returns {Decimal} + */ + mod(other) { + return new Decimal(this._big.mod(getBig(other))); + } + /** * Returns a new {@link Decimal} instance having the absolute value of * the current instance's value. @@ -19500,6 +19512,13 @@ describe('When instantiating a Decimal', () => { }).toThrow(); }); }); + describe('and modulo by zero', () => { + it('should throw', () => { + expect(() => { + let e = d.mod(0); + }).toThrow(); + }); + }); }); describe('from the string "1"', () => { let d;