diff --git a/src/function/arithmetic/add.js b/src/function/arithmetic/add.js index 424398610..b9bc0ae9a 100644 --- a/src/function/arithmetic/add.js +++ b/src/function/arithmetic/add.js @@ -24,39 +24,39 @@ export const createAdd = /* #__PURE__ */ factory( const matAlgo10xSids = createMatAlgo10xSids({ typed, DenseMatrix }) const matrixAlgorithmSuite = createMatrixAlgorithmSuite({ typed, matrix, concat }) /** - * Add two or more values, `x + y`. - * For matrices, the function is evaluated element wise. - * - * Syntax: - * - * math.add(x, y) - * math.add(x, y, z, ...) - * - * Examples: - * - * math.add(2, 3) // returns number 5 - * math.add(2, 3, 4) // returns number 9 - * - * const a = math.complex(2, 3) - * const b = math.complex(-4, 1) - * math.add(a, b) // returns Complex -2 + 4i - * - * math.add([1, 2, 3], 4) // returns Array [5, 6, 7] - * - * const c = math.unit('5 cm') - * const d = math.unit('2.1 mm') - * math.add(c, d) // returns Unit 52.1 mm - * - * math.add("2.3", "4") // returns number 6.3 - * - * See also: - * - * subtract, sum - * - * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add - * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add - * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y` - */ + * Add two or more values, `x + y`. + * For matrices, the function is evaluated element wise. + * + * Syntax: + * + * math.add(x, y) + * math.add(x, y, z, ...) + * + * Examples: + * + * math.add(2, 3) // returns number 5 + * math.add(2, 3, 4) // returns number 9 + * + * const a = math.complex(2, 3) + * const b = math.complex(-4, 1) + * math.add(a, b) // returns Complex -2 + 4i + * + * math.add([1, 2, 3], 4) // returns Array [5, 6, 7] + * + * const c = math.unit('5 cm') + * const d = math.unit('2.1 mm') + * math.add(c, d) // returns Unit 52.1 mm + * + * math.add("2.3", "4") // returns number 6.3 + * + * See also: + * + * subtract, sum + * + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} x First value to add + * @param {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} y Second value to add + * @return {number | BigNumber | bigint | Fraction | Complex | Unit | Array | Matrix} Sum of `x` and `y` + */ return typed( name, {