diff --git a/src/core/config.js b/src/core/config.js index f8c693e358..fc2c657984 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -20,5 +20,8 @@ export const DEFAULT_CONFIG = { // random seed for seeded pseudo random number generation // null = randomly seed - randomSeed: null + randomSeed: null, + + // Implicit multiplication boolean + implicitMultiplication: true } diff --git a/src/core/function/config.js b/src/core/function/config.js index 297b86fe0a..ee4e217ae3 100644 --- a/src/core/function/config.js +++ b/src/core/function/config.js @@ -39,6 +39,9 @@ export function configFactory (config, emit) { * {string} randomSeed * Random seed for seeded pseudo random number generator. * Set to null to randomly seed. + * {boolean} implicitMultiplication + * Boolean to set implicit multiplication. + * Default set to true * @return {Object} Returns the current configuration */ function _config (options) { diff --git a/test/entry/bundleAny.test.js b/test/entry/bundleAny.test.js index 4ae0d0591b..676f52b718 100644 --- a/test/entry/bundleAny.test.js +++ b/test/entry/bundleAny.test.js @@ -10,14 +10,16 @@ describe('bundleAny', function () { precision: 64, predictable: false, epsilon: 1e-12, - randomSeed: null + randomSeed: null, + implicitMultiplication: true }) }) it('should create an instance of math.js with custom configuration', function () { const math1 = math.create({ matrix: 'Array', - number: 'BigNumber' + number: 'BigNumber', + implicitMultiplication: false }) assert.strictEqual(typeof math1, 'object') @@ -27,7 +29,8 @@ describe('bundleAny', function () { precision: 64, predictable: false, epsilon: 1e-12, - randomSeed: null + randomSeed: null, + implicitMultiplication: false }) }) @@ -70,7 +73,8 @@ describe('bundleAny', function () { precision: 4, predictable: true, epsilon: 1e-12, - randomSeed: null + randomSeed: null, + implicitMultiplication: true }) assert.ok(math1.isNaN(math1.sqrt(-4))) @@ -90,7 +94,8 @@ describe('bundleAny', function () { precision: 64, predictable: false, epsilon: 1e-12, - randomSeed: null + randomSeed: null, + implicitMultiplication: true }) assert.deepStrictEqual(math1.sqrt(-4), math1.complex(0, 2))