mathjs 13.0.2 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HISTORY.md +26 -1
- package/lib/browser/math.js +1 -1
- package/lib/browser/math.js.LICENSE.txt +2 -2
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/core/create.js +12 -9
- package/lib/cjs/core/function/import.js +1 -1
- package/lib/cjs/core/function/typed.js +3 -4
- package/lib/cjs/entry/dependenciesAny/dependenciesFlatten.generated.js +0 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesSqueeze.generated.js +0 -2
- package/lib/cjs/entry/impureFunctionsAny.generated.js +2 -2
- package/lib/cjs/entry/pureFunctionsAny.generated.js +6 -8
- package/lib/cjs/entry/typeChecks.js +18 -0
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +2 -2
- package/lib/cjs/expression/embeddedDocs/function/arithmetic/hypot.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/diff.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/fft.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/ifft.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/kron.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/map.js +3 -3
- package/lib/cjs/expression/embeddedDocs/function/special/zeta.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/statistics/quantileSeq.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/trigonometry/acoth.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/trigonometry/acsch.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/utils/clone.js +1 -1
- package/lib/cjs/expression/function/evaluate.js +5 -0
- package/lib/cjs/expression/node/FunctionNode.js +1 -1
- package/lib/cjs/expression/transform/filter.transform.js +2 -2
- package/lib/cjs/expression/transform/map.transform.js +104 -37
- package/lib/cjs/expression/transform/utils/dimToZeroBase.js +23 -0
- package/lib/cjs/expression/transform/utils/lastDimToZeroBase.js +3 -4
- package/lib/cjs/function/arithmetic/hypot.js +3 -3
- package/lib/cjs/function/matrix/apply.js +1 -1
- package/lib/cjs/function/matrix/fft.js +3 -3
- package/lib/cjs/function/matrix/filter.js +2 -2
- package/lib/cjs/function/matrix/flatten.js +5 -6
- package/lib/cjs/function/matrix/ifft.js +2 -2
- package/lib/cjs/function/matrix/kron.js +4 -4
- package/lib/cjs/function/matrix/map.js +109 -18
- package/lib/cjs/function/matrix/size.js +7 -7
- package/lib/cjs/function/matrix/squeeze.js +3 -4
- package/lib/cjs/function/probability/random.js +1 -1
- package/lib/cjs/function/probability/randomInt.js +1 -1
- package/lib/cjs/function/statistics/cumsum.js +2 -2
- package/lib/cjs/function/trigonometry/acoth.js +2 -2
- package/lib/cjs/function/trigonometry/acsch.js +2 -2
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/type/matrix/DenseMatrix.js +3 -28
- package/lib/cjs/type/matrix/SparseMatrix.js +5 -8
- package/lib/cjs/type/unit/Unit.js +57 -114
- package/lib/cjs/utils/array.js +27 -0
- package/lib/cjs/utils/collection.js +1 -1
- package/lib/cjs/utils/function.js +0 -14
- package/lib/cjs/utils/is.js +27 -0
- package/lib/cjs/utils/map.js +2 -20
- package/lib/cjs/version.js +1 -1
- package/lib/esm/core/create.js +9 -6
- package/lib/esm/core/function/import.js +1 -1
- package/lib/esm/core/function/typed.js +2 -3
- package/lib/esm/entry/dependenciesAny/dependenciesFlatten.generated.js +0 -2
- package/lib/esm/entry/dependenciesAny/dependenciesSqueeze.generated.js +0 -2
- package/lib/esm/entry/impureFunctionsAny.generated.js +3 -3
- package/lib/esm/entry/pureFunctionsAny.generated.js +7 -9
- package/lib/esm/entry/typeChecks.js +1 -1
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +2 -2
- package/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/diff.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/fft.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/ifft.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/kron.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/map.js +3 -3
- package/lib/esm/expression/embeddedDocs/function/special/zeta.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/utils/clone.js +1 -1
- package/lib/esm/expression/function/compile.js +1 -1
- package/lib/esm/expression/function/evaluate.js +8 -3
- package/lib/esm/expression/node/FunctionNode.js +1 -1
- package/lib/esm/expression/parse.js +2 -2
- package/lib/esm/expression/transform/filter.transform.js +4 -4
- package/lib/esm/expression/transform/forEach.transform.js +4 -4
- package/lib/esm/expression/transform/map.transform.js +104 -37
- package/lib/esm/expression/transform/print.transform.js +2 -2
- package/lib/esm/expression/transform/utils/dimToZeroBase.js +16 -0
- package/lib/esm/expression/transform/utils/lastDimToZeroBase.js +4 -6
- package/lib/esm/function/algebra/decomposition/slu.js +1 -1
- package/lib/esm/function/algebra/derivative.js +15 -15
- package/lib/esm/function/algebra/lyap.js +4 -4
- package/lib/esm/function/algebra/simplify/util.js +3 -3
- package/lib/esm/function/algebra/simplifyConstant.js +9 -9
- package/lib/esm/function/algebra/solver/lsolve.js +3 -3
- package/lib/esm/function/algebra/solver/lsolveAll.js +3 -3
- package/lib/esm/function/algebra/solver/lusolve.js +5 -5
- package/lib/esm/function/algebra/solver/usolve.js +3 -3
- package/lib/esm/function/algebra/solver/usolveAll.js +3 -3
- package/lib/esm/function/algebra/sylvester.js +7 -7
- package/lib/esm/function/arithmetic/addScalar.js +4 -4
- package/lib/esm/function/arithmetic/ceil.js +6 -6
- package/lib/esm/function/arithmetic/divide.js +5 -5
- package/lib/esm/function/arithmetic/divideScalar.js +5 -5
- package/lib/esm/function/arithmetic/fix.js +5 -5
- package/lib/esm/function/arithmetic/floor.js +6 -6
- package/lib/esm/function/arithmetic/hypot.js +3 -3
- package/lib/esm/function/arithmetic/mod.js +3 -3
- package/lib/esm/function/arithmetic/multiply.js +7 -7
- package/lib/esm/function/arithmetic/multiplyScalar.js +4 -4
- package/lib/esm/function/arithmetic/norm.js +2 -2
- package/lib/esm/function/arithmetic/pow.js +6 -6
- package/lib/esm/function/arithmetic/round.js +7 -7
- package/lib/esm/function/arithmetic/subtractScalar.js +4 -4
- package/lib/esm/function/arithmetic/xgcd.js +1 -1
- package/lib/esm/function/combinatorics/bellNumbers.js +1 -1
- package/lib/esm/function/combinatorics/catalan.js +1 -1
- package/lib/esm/function/combinatorics/composition.js +1 -1
- package/lib/esm/function/combinatorics/stirlingS2.js +1 -1
- package/lib/esm/function/geometry/distance.js +4 -4
- package/lib/esm/function/geometry/intersect.js +2 -2
- package/lib/esm/function/logical/and.js +2 -2
- package/lib/esm/function/logical/or.js +2 -2
- package/lib/esm/function/logical/xor.js +2 -2
- package/lib/esm/function/matrix/apply.js +2 -2
- package/lib/esm/function/matrix/column.js +1 -1
- package/lib/esm/function/matrix/concat.js +1 -1
- package/lib/esm/function/matrix/count.js +1 -1
- package/lib/esm/function/matrix/cross.js +3 -3
- package/lib/esm/function/matrix/diag.js +10 -10
- package/lib/esm/function/matrix/diff.js +2 -2
- package/lib/esm/function/matrix/eigs.js +3 -3
- package/lib/esm/function/matrix/fft.js +3 -3
- package/lib/esm/function/matrix/filter.js +4 -4
- package/lib/esm/function/matrix/flatten.js +5 -6
- package/lib/esm/function/matrix/forEach.js +4 -4
- package/lib/esm/function/matrix/identity.js +6 -6
- package/lib/esm/function/matrix/ifft.js +3 -3
- package/lib/esm/function/matrix/inv.js +1 -1
- package/lib/esm/function/matrix/kron.js +7 -7
- package/lib/esm/function/matrix/map.js +110 -19
- package/lib/esm/function/matrix/matrixFromFunction.js +6 -6
- package/lib/esm/function/matrix/ones.js +2 -2
- package/lib/esm/function/matrix/partitionSelect.js +2 -2
- package/lib/esm/function/matrix/pinv.js +1 -1
- package/lib/esm/function/matrix/range.js +10 -10
- package/lib/esm/function/matrix/reshape.js +2 -2
- package/lib/esm/function/matrix/rotate.js +4 -4
- package/lib/esm/function/matrix/rotationMatrix.js +6 -6
- package/lib/esm/function/matrix/row.js +1 -1
- package/lib/esm/function/matrix/size.js +8 -8
- package/lib/esm/function/matrix/sort.js +4 -4
- package/lib/esm/function/matrix/sqrtm.js +1 -1
- package/lib/esm/function/matrix/squeeze.js +3 -4
- package/lib/esm/function/matrix/subset.js +2 -2
- package/lib/esm/function/matrix/zeros.js +2 -2
- package/lib/esm/function/probability/combinations.js +1 -1
- package/lib/esm/function/probability/combinationsWithRep.js +2 -2
- package/lib/esm/function/probability/kldivergence.js +4 -4
- package/lib/esm/function/probability/multinomial.js +1 -1
- package/lib/esm/function/probability/permutations.js +2 -2
- package/lib/esm/function/probability/pickRandom.js +6 -6
- package/lib/esm/function/probability/random.js +1 -1
- package/lib/esm/function/probability/randomInt.js +1 -1
- package/lib/esm/function/relational/compare.js +6 -6
- package/lib/esm/function/relational/deepEqual.js +1 -1
- package/lib/esm/function/relational/equal.js +1 -1
- package/lib/esm/function/relational/equalScalar.js +7 -7
- package/lib/esm/function/relational/equalText.js +1 -1
- package/lib/esm/function/relational/larger.js +3 -3
- package/lib/esm/function/relational/largerEq.js +4 -4
- package/lib/esm/function/relational/smaller.js +3 -3
- package/lib/esm/function/relational/smallerEq.js +3 -3
- package/lib/esm/function/relational/unequal.js +1 -1
- package/lib/esm/function/set/setCartesian.js +1 -1
- package/lib/esm/function/set/setDifference.js +1 -1
- package/lib/esm/function/set/setDistinct.js +1 -1
- package/lib/esm/function/set/setIntersect.js +1 -1
- package/lib/esm/function/set/setIsSubset.js +1 -1
- package/lib/esm/function/set/setMultiplicity.js +1 -1
- package/lib/esm/function/set/setPowerset.js +1 -1
- package/lib/esm/function/set/setSize.js +2 -2
- package/lib/esm/function/set/setSymDifference.js +1 -1
- package/lib/esm/function/set/setUnion.js +1 -1
- package/lib/esm/function/signal/freqz.js +6 -6
- package/lib/esm/function/statistics/corr.js +2 -2
- package/lib/esm/function/statistics/cumsum.js +3 -3
- package/lib/esm/function/statistics/max.js +1 -1
- package/lib/esm/function/statistics/median.js +3 -3
- package/lib/esm/function/statistics/min.js +1 -1
- package/lib/esm/function/statistics/prod.js +1 -1
- package/lib/esm/function/statistics/variance.js +2 -2
- package/lib/esm/function/string/bin.js +2 -2
- package/lib/esm/function/string/hex.js +2 -2
- package/lib/esm/function/string/oct.js +2 -2
- package/lib/esm/function/trigonometry/acoth.js +2 -2
- package/lib/esm/function/trigonometry/acsch.js +2 -2
- package/lib/esm/type/bigint.js +1 -1
- package/lib/esm/type/complex/function/complex.js +2 -2
- package/lib/esm/type/fraction/function/fraction.js +1 -1
- package/lib/esm/type/matrix/DenseMatrix.js +13 -38
- package/lib/esm/type/matrix/SparseMatrix.js +5 -8
- package/lib/esm/type/matrix/function/index.js +1 -1
- package/lib/esm/type/matrix/function/matrix.js +1 -1
- package/lib/esm/type/matrix/function/sparse.js +2 -2
- package/lib/esm/type/number.js +1 -1
- package/lib/esm/type/unit/Unit.js +57 -114
- package/lib/esm/type/unit/function/createUnit.js +3 -3
- package/lib/esm/type/unit/function/splitUnit.js +1 -1
- package/lib/esm/type/unit/function/unit.js +2 -2
- package/lib/esm/utils/array.js +26 -0
- package/lib/esm/utils/collection.js +1 -1
- package/lib/esm/utils/function.js +0 -13
- package/lib/esm/utils/is.js +24 -0
- package/lib/esm/utils/map.js +2 -19
- package/lib/esm/version.js +1 -1
- package/package.json +19 -19
- package/types/index.d.ts +108 -25
|
@@ -56,29 +56,29 @@ export var createPickRandom = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
56
56
|
* Returns an array with the configured number of elements when number is defined.
|
|
57
57
|
*/
|
|
58
58
|
return typed(name, {
|
|
59
|
-
'Array | Matrix': function
|
|
59
|
+
'Array | Matrix': function Array__Matrix(possibles) {
|
|
60
60
|
return _pickRandom(possibles, {});
|
|
61
61
|
},
|
|
62
|
-
'Array | Matrix, Object': function
|
|
62
|
+
'Array | Matrix, Object': function Array__Matrix_Object(possibles, options) {
|
|
63
63
|
return _pickRandom(possibles, options);
|
|
64
64
|
},
|
|
65
|
-
'Array | Matrix, number': function
|
|
65
|
+
'Array | Matrix, number': function Array__Matrix_number(possibles, number) {
|
|
66
66
|
return _pickRandom(possibles, {
|
|
67
67
|
number
|
|
68
68
|
});
|
|
69
69
|
},
|
|
70
|
-
'Array | Matrix, Array | Matrix': function
|
|
70
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(possibles, weights) {
|
|
71
71
|
return _pickRandom(possibles, {
|
|
72
72
|
weights
|
|
73
73
|
});
|
|
74
74
|
},
|
|
75
|
-
'Array | Matrix, Array | Matrix, number': function
|
|
75
|
+
'Array | Matrix, Array | Matrix, number': function Array__Matrix_Array__Matrix_number(possibles, weights, number) {
|
|
76
76
|
return _pickRandom(possibles, {
|
|
77
77
|
number,
|
|
78
78
|
weights
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
|
-
'Array | Matrix, number, Array | Matrix': function
|
|
81
|
+
'Array | Matrix, number, Array | Matrix': function Array__Matrix_number_Array__Matrix(possibles, number, weights) {
|
|
82
82
|
return _pickRandom(possibles, {
|
|
83
83
|
number,
|
|
84
84
|
weights
|
|
@@ -60,7 +60,7 @@ export var createRandom = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
60
60
|
});
|
|
61
61
|
function _randomMatrix(size, min, max) {
|
|
62
62
|
var res = randomMatrix(size.valueOf(), () => _random(min, max));
|
|
63
|
-
return isMatrix(size) ? size.create(res) : res;
|
|
63
|
+
return isMatrix(size) ? size.create(res, 'number') : res;
|
|
64
64
|
}
|
|
65
65
|
function _random(min, max) {
|
|
66
66
|
return min + rng() * (max - min);
|
|
@@ -59,7 +59,7 @@ export var createRandomInt = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
59
59
|
});
|
|
60
60
|
function _randomIntMatrix(size, min, max) {
|
|
61
61
|
var res = randomMatrix(size.valueOf(), () => _randomInt(min, max));
|
|
62
|
-
return isMatrix(size) ? size.create(res) : res;
|
|
62
|
+
return isMatrix(size) ? size.create(res, 'number') : res;
|
|
63
63
|
}
|
|
64
64
|
function _randomInt(min, max) {
|
|
65
65
|
return Math.floor(min + rng() * (max - min));
|
|
@@ -80,19 +80,19 @@ export var createCompare = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
80
80
|
typed,
|
|
81
81
|
config
|
|
82
82
|
}), {
|
|
83
|
-
'boolean, boolean': function
|
|
83
|
+
'boolean, boolean': function boolean_boolean(x, y) {
|
|
84
84
|
return x === y ? 0 : x > y ? 1 : -1;
|
|
85
85
|
},
|
|
86
|
-
'BigNumber, BigNumber': function
|
|
86
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
87
87
|
return bigNearlyEqual(x, y, config.relTol, config.absTol) ? new BigNumber(0) : new BigNumber(x.cmp(y));
|
|
88
88
|
},
|
|
89
|
-
'bigint, bigint': function
|
|
89
|
+
'bigint, bigint': function bigint_bigint(x, y) {
|
|
90
90
|
return x === y ? 0n : x > y ? 1n : -1n;
|
|
91
91
|
},
|
|
92
|
-
'Fraction, Fraction': function
|
|
92
|
+
'Fraction, Fraction': function Fraction_Fraction(x, y) {
|
|
93
93
|
return new Fraction(x.compare(y));
|
|
94
94
|
},
|
|
95
|
-
'Complex, Complex': function
|
|
95
|
+
'Complex, Complex': function Complex_Complex() {
|
|
96
96
|
throw new TypeError('No ordering relation is defined for complex numbers');
|
|
97
97
|
}
|
|
98
98
|
}, compareUnits, matrixAlgorithmSuite({
|
|
@@ -107,7 +107,7 @@ export var createCompareNumber = /* #__PURE__ */factory(name, ['typed', 'config'
|
|
|
107
107
|
config
|
|
108
108
|
} = _ref2;
|
|
109
109
|
return typed(name, {
|
|
110
|
-
'number, number': function
|
|
110
|
+
'number, number': function number_number(x, y) {
|
|
111
111
|
return nearlyEqual(x, y, config.relTol, config.absTol) ? 0 : x > y ? 1 : -1;
|
|
112
112
|
}
|
|
113
113
|
});
|
|
@@ -36,7 +36,7 @@ export var createDeepEqual = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
36
36
|
* Returns true when the input matrices have the same size and each of their elements is equal.
|
|
37
37
|
*/
|
|
38
38
|
return typed(name, {
|
|
39
|
-
'any, any': function
|
|
39
|
+
'any, any': function any_any(x, y) {
|
|
40
40
|
return _deepEqual(x.valueOf(), y.valueOf());
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -90,7 +90,7 @@ export var createEqualNumber = factory(name, ['typed', 'equalScalar'], _ref2 =>
|
|
|
90
90
|
equalScalar
|
|
91
91
|
} = _ref2;
|
|
92
92
|
return typed(name, {
|
|
93
|
-
'any, any': function
|
|
93
|
+
'any, any': function any_any(x, y) {
|
|
94
94
|
// strict equality for null and undefined?
|
|
95
95
|
if (x === null) {
|
|
96
96
|
return y === null;
|
|
@@ -23,22 +23,22 @@ export var createEqualScalar = /* #__PURE__ */factory(name, dependencies, _ref =
|
|
|
23
23
|
* @private
|
|
24
24
|
*/
|
|
25
25
|
return typed(name, {
|
|
26
|
-
'boolean, boolean': function
|
|
26
|
+
'boolean, boolean': function boolean_boolean(x, y) {
|
|
27
27
|
return x === y;
|
|
28
28
|
},
|
|
29
|
-
'number, number': function
|
|
29
|
+
'number, number': function number_number(x, y) {
|
|
30
30
|
return nearlyEqual(x, y, config.relTol, config.absTol);
|
|
31
31
|
},
|
|
32
|
-
'BigNumber, BigNumber': function
|
|
32
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
33
33
|
return x.eq(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);
|
|
34
34
|
},
|
|
35
|
-
'bigint, bigint': function
|
|
35
|
+
'bigint, bigint': function bigint_bigint(x, y) {
|
|
36
36
|
return x === y;
|
|
37
37
|
},
|
|
38
|
-
'Fraction, Fraction': function
|
|
38
|
+
'Fraction, Fraction': function Fraction_Fraction(x, y) {
|
|
39
39
|
return x.equals(y);
|
|
40
40
|
},
|
|
41
|
-
'Complex, Complex': function
|
|
41
|
+
'Complex, Complex': function Complex_Complex(x, y) {
|
|
42
42
|
return complexEquals(x, y, config.relTol, config.absTol);
|
|
43
43
|
}
|
|
44
44
|
}, compareUnits);
|
|
@@ -49,7 +49,7 @@ export var createEqualScalarNumber = factory(name, ['typed', 'config'], _ref2 =>
|
|
|
49
49
|
config
|
|
50
50
|
} = _ref2;
|
|
51
51
|
return typed(name, {
|
|
52
|
-
'number, number': function
|
|
52
|
+
'number, number': function number_number(x, y) {
|
|
53
53
|
return nearlyEqual(x, y, config.relTol, config.absTol);
|
|
54
54
|
}
|
|
55
55
|
});
|
|
@@ -34,7 +34,7 @@ export var createEqualText = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
34
34
|
* @return {number | Array | DenseMatrix} Returns true if the values are equal, and false if not.
|
|
35
35
|
*/
|
|
36
36
|
return typed(name, {
|
|
37
|
-
'any, any': function
|
|
37
|
+
'any, any': function any_any(x, y) {
|
|
38
38
|
return isZero(compareText(x, y));
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -72,12 +72,12 @@ export var createLarger = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
72
72
|
config
|
|
73
73
|
}), {
|
|
74
74
|
'boolean, boolean': (x, y) => x > y,
|
|
75
|
-
'BigNumber, BigNumber': function
|
|
75
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
76
76
|
return x.gt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);
|
|
77
77
|
},
|
|
78
78
|
'bigint, bigint': (x, y) => x > y,
|
|
79
79
|
'Fraction, Fraction': (x, y) => x.compare(y) === 1,
|
|
80
|
-
'Complex, Complex': function
|
|
80
|
+
'Complex, Complex': function Complex_Complex() {
|
|
81
81
|
throw new TypeError('No ordering relation is defined for complex numbers');
|
|
82
82
|
}
|
|
83
83
|
}, compareUnits, matrixAlgorithmSuite({
|
|
@@ -92,7 +92,7 @@ export var createLargerNumber = /* #__PURE__ */factory(name, ['typed', 'config']
|
|
|
92
92
|
config
|
|
93
93
|
} = _ref2;
|
|
94
94
|
return typed(name, {
|
|
95
|
-
'number, number': function
|
|
95
|
+
'number, number': function number_number(x, y) {
|
|
96
96
|
return x > y && !nearlyEqual(x, y, config.relTol, config.absTol);
|
|
97
97
|
}
|
|
98
98
|
});
|
|
@@ -68,14 +68,14 @@ export var createLargerEq = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
68
68
|
config
|
|
69
69
|
}), {
|
|
70
70
|
'boolean, boolean': (x, y) => x >= y,
|
|
71
|
-
'BigNumber, BigNumber': function
|
|
71
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
72
72
|
return x.gte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);
|
|
73
73
|
},
|
|
74
|
-
'bigint, bigint': function
|
|
74
|
+
'bigint, bigint': function bigint_bigint(x, y) {
|
|
75
75
|
return x >= y;
|
|
76
76
|
},
|
|
77
77
|
'Fraction, Fraction': (x, y) => x.compare(y) !== -1,
|
|
78
|
-
'Complex, Complex': function
|
|
78
|
+
'Complex, Complex': function Complex_Complex() {
|
|
79
79
|
throw new TypeError('No ordering relation is defined for complex numbers');
|
|
80
80
|
}
|
|
81
81
|
}, compareUnits, matrixAlgorithmSuite({
|
|
@@ -90,7 +90,7 @@ export var createLargerEqNumber = /* #__PURE__ */factory(name, ['typed', 'config
|
|
|
90
90
|
config
|
|
91
91
|
} = _ref2;
|
|
92
92
|
return typed(name, {
|
|
93
|
-
'number, number': function
|
|
93
|
+
'number, number': function number_number(x, y) {
|
|
94
94
|
return x >= y || nearlyEqual(x, y, config.relTol, config.absTol);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -72,12 +72,12 @@ export var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
72
72
|
config
|
|
73
73
|
}), {
|
|
74
74
|
'boolean, boolean': (x, y) => x < y,
|
|
75
|
-
'BigNumber, BigNumber': function
|
|
75
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
76
76
|
return x.lt(y) && !bigNearlyEqual(x, y, config.relTol, config.absTol);
|
|
77
77
|
},
|
|
78
78
|
'bigint, bigint': (x, y) => x < y,
|
|
79
79
|
'Fraction, Fraction': (x, y) => x.compare(y) === -1,
|
|
80
|
-
'Complex, Complex': function
|
|
80
|
+
'Complex, Complex': function Complex_Complex(x, y) {
|
|
81
81
|
throw new TypeError('No ordering relation is defined for complex numbers');
|
|
82
82
|
}
|
|
83
83
|
}, compareUnits, matrixAlgorithmSuite({
|
|
@@ -92,7 +92,7 @@ export var createSmallerNumber = /* #__PURE__ */factory(name, ['typed', 'config'
|
|
|
92
92
|
config
|
|
93
93
|
} = _ref2;
|
|
94
94
|
return typed(name, {
|
|
95
|
-
'number, number': function
|
|
95
|
+
'number, number': function number_number(x, y) {
|
|
96
96
|
return x < y && !nearlyEqual(x, y, config.relTol, config.absTol);
|
|
97
97
|
}
|
|
98
98
|
});
|
|
@@ -68,12 +68,12 @@ export var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
68
68
|
config
|
|
69
69
|
}), {
|
|
70
70
|
'boolean, boolean': (x, y) => x <= y,
|
|
71
|
-
'BigNumber, BigNumber': function
|
|
71
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(x, y) {
|
|
72
72
|
return x.lte(y) || bigNearlyEqual(x, y, config.relTol, config.absTol);
|
|
73
73
|
},
|
|
74
74
|
'bigint, bigint': (x, y) => x <= y,
|
|
75
75
|
'Fraction, Fraction': (x, y) => x.compare(y) !== 1,
|
|
76
|
-
'Complex, Complex': function
|
|
76
|
+
'Complex, Complex': function Complex_Complex() {
|
|
77
77
|
throw new TypeError('No ordering relation is defined for complex numbers');
|
|
78
78
|
}
|
|
79
79
|
}, compareUnits, matrixAlgorithmSuite({
|
|
@@ -88,7 +88,7 @@ export var createSmallerEqNumber = /* #__PURE__ */factory(name, ['typed', 'confi
|
|
|
88
88
|
config
|
|
89
89
|
} = _ref2;
|
|
90
90
|
return typed(name, {
|
|
91
|
-
'number, number': function
|
|
91
|
+
'number, number': function number_number(x, y) {
|
|
92
92
|
return x <= y || nearlyEqual(x, y, config.relTol, config.absTol);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
@@ -93,7 +93,7 @@ export var createUnequalNumber = factory(name, ['typed', 'equalScalar'], _ref2 =
|
|
|
93
93
|
equalScalar
|
|
94
94
|
} = _ref2;
|
|
95
95
|
return typed(name, {
|
|
96
|
-
'any, any': function
|
|
96
|
+
'any, any': function any_any(x, y) {
|
|
97
97
|
// strict equality for null and undefined?
|
|
98
98
|
if (x === null) {
|
|
99
99
|
return y !== null;
|
|
@@ -34,7 +34,7 @@ export var createSetCartesian = /* #__PURE__ */factory(name, dependencies, _ref
|
|
|
34
34
|
* @return {Array | Matrix} The cartesian product of two (multi)sets
|
|
35
35
|
*/
|
|
36
36
|
return typed(name, {
|
|
37
|
-
'Array | Matrix, Array | Matrix': function
|
|
37
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
38
38
|
var result = [];
|
|
39
39
|
if (subset(size(a1), new Index(0)) !== 0 && subset(size(a2), new Index(0)) !== 0) {
|
|
40
40
|
// if any of them is empty, return empty
|
|
@@ -33,7 +33,7 @@ export var createSetDifference = /* #__PURE__ */factory(name, dependencies, _ref
|
|
|
33
33
|
* @return {Array | Matrix} The difference of two (multi)sets
|
|
34
34
|
*/
|
|
35
35
|
return typed(name, {
|
|
36
|
-
'Array | Matrix, Array | Matrix': function
|
|
36
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
37
37
|
var result;
|
|
38
38
|
if (subset(size(a1), new Index(0)) === 0) {
|
|
39
39
|
// empty-anything=empty
|
|
@@ -31,7 +31,7 @@ export var createSetDistinct = /* #__PURE__ */factory(name, dependencies, _ref =
|
|
|
31
31
|
* @return {Array | Matrix} A set containing the distinc elements of the multiset
|
|
32
32
|
*/
|
|
33
33
|
return typed(name, {
|
|
34
|
-
'Array | Matrix': function
|
|
34
|
+
'Array | Matrix': function Array__Matrix(a) {
|
|
35
35
|
var result;
|
|
36
36
|
if (subset(size(a), new Index(0)) === 0) {
|
|
37
37
|
// if empty, return empty
|
|
@@ -33,7 +33,7 @@ export var createSetIntersect = /* #__PURE__ */factory(name, dependencies, _ref
|
|
|
33
33
|
* @return {Array | Matrix} The intersection of two (multi)sets
|
|
34
34
|
*/
|
|
35
35
|
return typed(name, {
|
|
36
|
-
'Array | Matrix, Array | Matrix': function
|
|
36
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
37
37
|
var result;
|
|
38
38
|
if (subset(size(a1), new Index(0)) === 0 || subset(size(a2), new Index(0)) === 0) {
|
|
39
39
|
// of any of them is empty, return empty
|
|
@@ -32,7 +32,7 @@ export var createSetIsSubset = /* #__PURE__ */factory(name, dependencies, _ref =
|
|
|
32
32
|
* @return {boolean} Returns true when a1 is a subset of a2, returns false otherwise
|
|
33
33
|
*/
|
|
34
34
|
return typed(name, {
|
|
35
|
-
'Array | Matrix, Array | Matrix': function
|
|
35
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
36
36
|
if (subset(size(a1), new Index(0)) === 0) {
|
|
37
37
|
// empty is a subset of anything
|
|
38
38
|
return true;
|
|
@@ -32,7 +32,7 @@ export var createSetMultiplicity = /* #__PURE__ */factory(name, dependencies, _r
|
|
|
32
32
|
* @return {number} The number of how many times the multiset contains the element
|
|
33
33
|
*/
|
|
34
34
|
return typed(name, {
|
|
35
|
-
'number | BigNumber | Fraction | Complex, Array | Matrix': function
|
|
35
|
+
'number | BigNumber | Fraction | Complex, Array | Matrix': function number__BigNumber__Fraction__Complex_Array__Matrix(e, a) {
|
|
36
36
|
if (subset(size(a), new Index(0)) === 0) {
|
|
37
37
|
// if empty, return 0
|
|
38
38
|
return 0;
|
|
@@ -30,7 +30,7 @@ export var createSetPowerset = /* #__PURE__ */factory(name, dependencies, _ref =
|
|
|
30
30
|
* @return {Array} The powerset of the (multi)set
|
|
31
31
|
*/
|
|
32
32
|
return typed(name, {
|
|
33
|
-
'Array | Matrix': function
|
|
33
|
+
'Array | Matrix': function Array__Matrix(a) {
|
|
34
34
|
if (subset(size(a), new Index(0)) === 0) {
|
|
35
35
|
// if empty, return empty
|
|
36
36
|
return [];
|
|
@@ -30,10 +30,10 @@ export var createSetSize = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
30
30
|
* @return {number} The number of elements of the (multi)set
|
|
31
31
|
*/
|
|
32
32
|
return typed(name, {
|
|
33
|
-
'Array | Matrix': function
|
|
33
|
+
'Array | Matrix': function Array__Matrix(a) {
|
|
34
34
|
return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;
|
|
35
35
|
},
|
|
36
|
-
'Array | Matrix, boolean': function
|
|
36
|
+
'Array | Matrix, boolean': function Array__Matrix_boolean(a, unique) {
|
|
37
37
|
if (unique === false || a.length === 0) {
|
|
38
38
|
return Array.isArray(a) ? flatten(a).length : flatten(a.toArray()).length;
|
|
39
39
|
} else {
|
|
@@ -33,7 +33,7 @@ export var createSetSymDifference = /* #__PURE__ */factory(name, dependencies, _
|
|
|
33
33
|
* @return {Array | Matrix} The symmetric difference of two (multi)sets
|
|
34
34
|
*/
|
|
35
35
|
return typed(name, {
|
|
36
|
-
'Array | Matrix, Array | Matrix': function
|
|
36
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
37
37
|
if (subset(size(a1), new Index(0)) === 0) {
|
|
38
38
|
// if any of them is empty, return the other one
|
|
39
39
|
return flatten(a2);
|
|
@@ -34,7 +34,7 @@ export var createSetUnion = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
34
34
|
* @return {Array | Matrix} The union of two (multi)sets
|
|
35
35
|
*/
|
|
36
36
|
return typed(name, {
|
|
37
|
-
'Array | Matrix, Array | Matrix': function
|
|
37
|
+
'Array | Matrix, Array | Matrix': function Array__Matrix_Array__Matrix(a1, a2) {
|
|
38
38
|
if (subset(size(a1), new Index(0)) === 0) {
|
|
39
39
|
// if any of them is empty, return the other one
|
|
40
40
|
return flatten(a2);
|
|
@@ -32,21 +32,21 @@ export var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
return typed(name, {
|
|
35
|
-
'Array, Array': function
|
|
35
|
+
'Array, Array': function Array_Array(b, a) {
|
|
36
36
|
var w = createBins(512);
|
|
37
37
|
return _freqz(b, a, w);
|
|
38
38
|
},
|
|
39
|
-
'Array, Array, Array': function
|
|
39
|
+
'Array, Array, Array': function Array_Array_Array(b, a, w) {
|
|
40
40
|
return _freqz(b, a, w);
|
|
41
41
|
},
|
|
42
|
-
'Array, Array, number': function
|
|
42
|
+
'Array, Array, number': function Array_Array_number(b, a, w) {
|
|
43
43
|
if (w < 0) {
|
|
44
44
|
throw new Error('w must be a positive number');
|
|
45
45
|
}
|
|
46
46
|
var w2 = createBins(w);
|
|
47
47
|
return _freqz(b, a, w2);
|
|
48
48
|
},
|
|
49
|
-
'Matrix, Matrix': function
|
|
49
|
+
'Matrix, Matrix': function Matrix_Matrix(b, a) {
|
|
50
50
|
// console.log('here')
|
|
51
51
|
var _w = createBins(512);
|
|
52
52
|
var {
|
|
@@ -58,7 +58,7 @@ export var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
58
58
|
h: matrix(h)
|
|
59
59
|
};
|
|
60
60
|
},
|
|
61
|
-
'Matrix, Matrix, Matrix': function
|
|
61
|
+
'Matrix, Matrix, Matrix': function Matrix_Matrix_Matrix(b, a, w) {
|
|
62
62
|
var {
|
|
63
63
|
h
|
|
64
64
|
} = _freqz(b.valueOf(), a.valueOf(), w.valueOf());
|
|
@@ -67,7 +67,7 @@ export var createFreqz = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
67
67
|
w: matrix(w)
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
|
-
'Matrix, Matrix, number': function
|
|
70
|
+
'Matrix, Matrix, number': function Matrix_Matrix_number(b, a, w) {
|
|
71
71
|
if (w < 0) {
|
|
72
72
|
throw new Error('w must be a positive number');
|
|
73
73
|
}
|
|
@@ -35,10 +35,10 @@ export var createCorr = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
35
35
|
* @return {*} The correlation coefficient
|
|
36
36
|
*/
|
|
37
37
|
return typed(name, {
|
|
38
|
-
'Array, Array': function
|
|
38
|
+
'Array, Array': function Array_Array(A, B) {
|
|
39
39
|
return _corr(A, B);
|
|
40
40
|
},
|
|
41
|
-
'Matrix, Matrix': function
|
|
41
|
+
'Matrix, Matrix': function Matrix_Matrix(A, B) {
|
|
42
42
|
var res = _corr(A.toArray(), B.toArray());
|
|
43
43
|
return Array.isArray(res) ? matrix(res) : res;
|
|
44
44
|
}
|
|
@@ -42,12 +42,12 @@ export var createCumSum = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
42
42
|
// sum([a, b, c, d, ...])
|
|
43
43
|
Array: _cumsum,
|
|
44
44
|
Matrix: function Matrix(matrix) {
|
|
45
|
-
return matrix.create(_cumsum(matrix.valueOf()));
|
|
45
|
+
return matrix.create(_cumsum(matrix.valueOf(), matrix.datatype()));
|
|
46
46
|
},
|
|
47
47
|
// sum([a, b, c, d, ...], dim)
|
|
48
48
|
'Array, number | BigNumber': _ncumSumDim,
|
|
49
|
-
'Matrix, number | BigNumber': function
|
|
50
|
-
return matrix.create(_ncumSumDim(matrix.valueOf(), dim));
|
|
49
|
+
'Matrix, number | BigNumber': function Matrix_number__BigNumber(matrix, dim) {
|
|
50
|
+
return matrix.create(_ncumSumDim(matrix.valueOf(), dim), matrix.datatype());
|
|
51
51
|
},
|
|
52
52
|
// cumsum(a, b, c, d, ...)
|
|
53
53
|
'...': function _(args) {
|
|
@@ -46,7 +46,7 @@ export var createMax = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
46
46
|
// max([a, b, c, d, ...])
|
|
47
47
|
'Array | Matrix': _max,
|
|
48
48
|
// max([a, b, c, d, ...], dim)
|
|
49
|
-
'Array | Matrix, number | BigNumber': function
|
|
49
|
+
'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {
|
|
50
50
|
return reduce(array, dim.valueOf(), _largest);
|
|
51
51
|
},
|
|
52
52
|
// max(a, b, c, d, ...)
|
|
@@ -50,14 +50,14 @@ export var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
50
50
|
|
|
51
51
|
// helper function to type check the middle value of the array
|
|
52
52
|
var middle = typed({
|
|
53
|
-
'number | BigNumber | Complex | Unit': function
|
|
53
|
+
'number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit(value) {
|
|
54
54
|
return value;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
// helper function to type check the two middle value of the array
|
|
59
59
|
var middle2 = typed({
|
|
60
|
-
'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function
|
|
60
|
+
'number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit': function number__BigNumber__Complex__Unit_number__BigNumber__Complex__Unit(left, right) {
|
|
61
61
|
return divide(add(left, right), 2);
|
|
62
62
|
}
|
|
63
63
|
});
|
|
@@ -92,7 +92,7 @@ export var createMedian = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
92
92
|
// median([a, b, c, d, ...])
|
|
93
93
|
'Array | Matrix': _median,
|
|
94
94
|
// median([a, b, c, d, ...], dim)
|
|
95
|
-
'Array | Matrix, number | BigNumber': function
|
|
95
|
+
'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {
|
|
96
96
|
// TODO: implement median(A, dim)
|
|
97
97
|
throw new Error('median(A, dim) is not yet supported');
|
|
98
98
|
// return reduce(arguments[0], arguments[1], ...)
|
|
@@ -46,7 +46,7 @@ export var createMin = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
46
46
|
// min([a, b, c, d, ...])
|
|
47
47
|
'Array | Matrix': _min,
|
|
48
48
|
// min([a, b, c, d, ...], dim)
|
|
49
|
-
'Array | Matrix, number | BigNumber': function
|
|
49
|
+
'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {
|
|
50
50
|
return reduce(array, dim.valueOf(), _smallest);
|
|
51
51
|
},
|
|
52
52
|
// min(a, b, c, d, ...)
|
|
@@ -40,7 +40,7 @@ export var createProd = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
40
40
|
// prod([a, b, c, d, ...])
|
|
41
41
|
'Array | Matrix': _prod,
|
|
42
42
|
// prod([a, b, c, d, ...], dim)
|
|
43
|
-
'Array | Matrix, number | BigNumber': function
|
|
43
|
+
'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {
|
|
44
44
|
// TODO: implement prod(A, dim)
|
|
45
45
|
throw new Error('prod(A, dim) is not yet supported');
|
|
46
46
|
// return reduce(arguments[0], arguments[1], math.prod)
|
|
@@ -70,13 +70,13 @@ export var createVariance = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
70
70
|
*/
|
|
71
71
|
return typed(name, {
|
|
72
72
|
// variance([a, b, c, d, ...])
|
|
73
|
-
'Array | Matrix': function
|
|
73
|
+
'Array | Matrix': function Array__Matrix(array) {
|
|
74
74
|
return _var(array, DEFAULT_NORMALIZATION);
|
|
75
75
|
},
|
|
76
76
|
// variance([a, b, c, d, ...], normalization)
|
|
77
77
|
'Array | Matrix, string': _var,
|
|
78
78
|
// variance([a, b, c, c, ...], dim)
|
|
79
|
-
'Array | Matrix, number | BigNumber': function
|
|
79
|
+
'Array | Matrix, number | BigNumber': function Array__Matrix_number__BigNumber(array, dim) {
|
|
80
80
|
return _varDim(array, dim, DEFAULT_NORMALIZATION);
|
|
81
81
|
},
|
|
82
82
|
// variance([a, b, c, c, ...], dim, normalization)
|
|
@@ -29,12 +29,12 @@ export var createBin = factory(name, dependencies, _ref => {
|
|
|
29
29
|
format
|
|
30
30
|
} = _ref;
|
|
31
31
|
return typed(name, {
|
|
32
|
-
'number | BigNumber': function
|
|
32
|
+
'number | BigNumber': function number__BigNumber(n) {
|
|
33
33
|
return format(n, {
|
|
34
34
|
notation: 'bin'
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
-
'number | BigNumber, number | BigNumber': function
|
|
37
|
+
'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {
|
|
38
38
|
return format(n, {
|
|
39
39
|
notation: 'bin',
|
|
40
40
|
wordSize
|
|
@@ -28,12 +28,12 @@ export var createHex = factory(name, dependencies, _ref => {
|
|
|
28
28
|
format
|
|
29
29
|
} = _ref;
|
|
30
30
|
return typed(name, {
|
|
31
|
-
'number | BigNumber': function
|
|
31
|
+
'number | BigNumber': function number__BigNumber(n) {
|
|
32
32
|
return format(n, {
|
|
33
33
|
notation: 'hex'
|
|
34
34
|
});
|
|
35
35
|
},
|
|
36
|
-
'number | BigNumber, number | BigNumber': function
|
|
36
|
+
'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {
|
|
37
37
|
return format(n, {
|
|
38
38
|
notation: 'hex',
|
|
39
39
|
wordSize
|
|
@@ -30,12 +30,12 @@ export var createOct = factory(name, dependencies, _ref => {
|
|
|
30
30
|
format
|
|
31
31
|
} = _ref;
|
|
32
32
|
return typed(name, {
|
|
33
|
-
'number | BigNumber': function
|
|
33
|
+
'number | BigNumber': function number__BigNumber(n) {
|
|
34
34
|
return format(n, {
|
|
35
35
|
notation: 'oct'
|
|
36
36
|
});
|
|
37
37
|
},
|
|
38
|
-
'number | BigNumber, number | BigNumber': function
|
|
38
|
+
'number | BigNumber, number | BigNumber': function number__BigNumber_number__BigNumber(n, wordSize) {
|
|
39
39
|
return format(n, {
|
|
40
40
|
notation: 'oct',
|
|
41
41
|
wordSize
|
|
@@ -10,10 +10,10 @@ export var createAcoth = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
10
10
|
BigNumber: _BigNumber
|
|
11
11
|
} = _ref;
|
|
12
12
|
/**
|
|
13
|
-
* Calculate the hyperbolic
|
|
13
|
+
* Calculate the inverse hyperbolic tangent of a value,
|
|
14
14
|
* defined as `acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.
|
|
15
15
|
*
|
|
16
|
-
* To avoid confusion with the matrix hyperbolic
|
|
16
|
+
* To avoid confusion with the matrix inverse hyperbolic tangent, this
|
|
17
17
|
* function does not apply to matrices.
|
|
18
18
|
*
|
|
19
19
|
* Syntax:
|
|
@@ -8,10 +8,10 @@ export var createAcsch = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
8
8
|
BigNumber: _BigNumber
|
|
9
9
|
} = _ref;
|
|
10
10
|
/**
|
|
11
|
-
* Calculate the hyperbolic
|
|
11
|
+
* Calculate the inverse hyperbolic cosecant of a value,
|
|
12
12
|
* defined as `acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1))`.
|
|
13
13
|
*
|
|
14
|
-
* To avoid confusion with the matrix hyperbolic
|
|
14
|
+
* To avoid confusion with the matrix inverse hyperbolic cosecant, this function
|
|
15
15
|
* does not apply to matrices.
|
|
16
16
|
*
|
|
17
17
|
* Syntax:
|
package/lib/esm/type/bigint.js
CHANGED
|
@@ -44,7 +44,7 @@ export var createBigint = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
44
44
|
Fraction: function Fraction(x) {
|
|
45
45
|
return BigInt(x.valueOf().toFixed());
|
|
46
46
|
},
|
|
47
|
-
'string | boolean': function
|
|
47
|
+
'string | boolean': function string__boolean(x) {
|
|
48
48
|
return BigInt(x);
|
|
49
49
|
},
|
|
50
50
|
null: function _null(x) {
|
|
@@ -52,11 +52,11 @@ export var createComplex = /* #__PURE__ */factory(name, dependencies, _ref => {
|
|
|
52
52
|
number: function number(x) {
|
|
53
53
|
return new Complex(x, 0);
|
|
54
54
|
},
|
|
55
|
-
'number, number': function
|
|
55
|
+
'number, number': function number_number(re, im) {
|
|
56
56
|
return new Complex(re, im);
|
|
57
57
|
},
|
|
58
58
|
// TODO: this signature should be redundant
|
|
59
|
-
'BigNumber, BigNumber': function
|
|
59
|
+
'BigNumber, BigNumber': function BigNumber_BigNumber(re, im) {
|
|
60
60
|
return new Complex(re.toNumber(), im.toNumber());
|
|
61
61
|
},
|
|
62
62
|
Fraction: function Fraction(x) {
|