mathjs 10.6.2 → 11.0.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 +74 -1
- package/README.md +1 -1
- package/lib/browser/math.js +2 -41
- package/lib/browser/math.js.LICENSE.txt +43 -0
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/core/create.js +6 -5
- package/lib/cjs/core/function/import.js +4 -14
- package/lib/cjs/core/function/typed.js +54 -12
- package/lib/cjs/defaultInstance.js +3 -3
- package/lib/cjs/entry/allFactoriesAny.js +1 -1
- package/lib/cjs/entry/allFactoriesNumber.js +1 -1
- package/lib/cjs/entry/configReadonly.js +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesChainClass.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesKldivergence.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesResolve.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +56 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSimplifyCore.generated.js +6 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesSqrtm.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesStd.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesStdTransform.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny.generated.js +8 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesChainClass.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesResolve.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +50 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js +6 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesStd.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesStdTransform.generated.js +3 -0
- package/lib/cjs/entry/dependenciesNumber.generated.js +8 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +87 -61
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +93 -69
- package/lib/cjs/entry/pureFunctionsAny.generated.js +50 -45
- package/lib/cjs/entry/pureFunctionsNumber.generated.js +22 -19
- package/lib/cjs/expression/Parser.js +1 -1
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +8 -5
- package/lib/cjs/expression/embeddedDocs/function/algebra/simplifyConstant.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/algebra/simplifyCore.js +1 -1
- package/lib/cjs/expression/node/AccessorNode.js +216 -173
- package/lib/cjs/expression/node/ArrayNode.js +206 -160
- package/lib/cjs/expression/node/AssignmentNode.js +321 -270
- package/lib/cjs/expression/node/BlockNode.js +223 -172
- package/lib/cjs/expression/node/ConditionalNode.js +253 -193
- package/lib/cjs/expression/node/ConstantNode.js +216 -171
- package/lib/cjs/expression/node/FunctionAssignmentNode.js +258 -196
- package/lib/cjs/expression/node/FunctionNode.js +456 -416
- package/lib/cjs/expression/node/IndexNode.js +256 -210
- package/lib/cjs/expression/node/Node.js +411 -378
- package/lib/cjs/expression/node/ObjectNode.js +223 -178
- package/lib/cjs/expression/node/OperatorNode.js +474 -397
- package/lib/cjs/expression/node/ParenthesisNode.js +189 -143
- package/lib/cjs/expression/node/RangeNode.js +272 -224
- package/lib/cjs/expression/node/RelationalNode.js +246 -195
- package/lib/cjs/expression/node/SymbolNode.js +219 -172
- package/lib/cjs/expression/node/utils/access.js +1 -1
- package/lib/cjs/expression/node/utils/assign.js +1 -1
- package/lib/cjs/expression/operators.js +117 -23
- package/lib/cjs/expression/parse.js +37 -19
- package/lib/cjs/expression/transform/std.transform.js +3 -1
- package/lib/cjs/factoriesAny.js +8 -0
- package/lib/cjs/factoriesNumber.js +10 -1
- package/lib/cjs/function/algebra/decomposition/qr.js +1 -1
- package/lib/cjs/function/algebra/derivative.js +22 -30
- package/lib/cjs/function/algebra/leafCount.js +0 -3
- package/lib/cjs/function/algebra/rationalize.js +78 -108
- package/lib/cjs/function/algebra/resolve.js +53 -16
- package/lib/cjs/function/algebra/simplify/util.js +1 -1
- package/lib/cjs/function/algebra/simplify.js +87 -114
- package/lib/cjs/function/algebra/{simplify/simplifyConstant.js → simplifyConstant.js} +44 -10
- package/lib/cjs/function/algebra/simplifyCore.js +196 -93
- package/lib/cjs/function/algebra/solver/lsolveAll.js +2 -2
- package/lib/cjs/function/algebra/solver/usolveAll.js +2 -2
- package/lib/cjs/function/algebra/symbolicEqual.js +9 -26
- package/lib/cjs/function/arithmetic/abs.js +7 -14
- package/lib/cjs/function/arithmetic/add.js +26 -70
- package/lib/cjs/function/arithmetic/addScalar.js +17 -9
- package/lib/cjs/function/arithmetic/cbrt.js +7 -11
- package/lib/cjs/function/arithmetic/ceil.js +56 -46
- package/lib/cjs/function/arithmetic/cube.js +5 -10
- package/lib/cjs/function/arithmetic/divide.js +7 -7
- package/lib/cjs/function/arithmetic/divideScalar.js +4 -18
- package/lib/cjs/function/arithmetic/dotDivide.js +22 -65
- package/lib/cjs/function/arithmetic/dotMultiply.js +16 -61
- package/lib/cjs/function/arithmetic/dotPow.js +30 -63
- package/lib/cjs/function/arithmetic/exp.js +8 -12
- package/lib/cjs/function/arithmetic/expm1.js +10 -10
- package/lib/cjs/function/arithmetic/fix.js +33 -27
- package/lib/cjs/function/arithmetic/floor.js +56 -46
- package/lib/cjs/function/arithmetic/gcd.js +27 -68
- package/lib/cjs/function/arithmetic/hypot.js +9 -5
- package/lib/cjs/function/arithmetic/invmod.js +1 -1
- package/lib/cjs/function/arithmetic/lcm.js +27 -68
- package/lib/cjs/function/arithmetic/log.js +10 -12
- package/lib/cjs/function/arithmetic/log10.js +5 -3
- package/lib/cjs/function/arithmetic/log1p.js +11 -7
- package/lib/cjs/function/arithmetic/log2.js +5 -3
- package/lib/cjs/function/arithmetic/mod.js +22 -64
- package/lib/cjs/function/arithmetic/multiply.js +40 -35
- package/lib/cjs/function/arithmetic/multiplyScalar.js +2 -9
- package/lib/cjs/function/arithmetic/norm.js +1 -5
- package/lib/cjs/function/arithmetic/nthRoot.js +80 -92
- package/lib/cjs/function/arithmetic/round.js +56 -42
- package/lib/cjs/function/arithmetic/sign.js +14 -10
- package/lib/cjs/function/arithmetic/sqrt.js +5 -9
- package/lib/cjs/function/arithmetic/square.js +6 -10
- package/lib/cjs/function/arithmetic/subtract.js +44 -100
- package/lib/cjs/function/arithmetic/unaryMinus.js +14 -16
- package/lib/cjs/function/arithmetic/unaryPlus.js +6 -4
- package/lib/cjs/function/bitwise/bitAnd.js +17 -61
- package/lib/cjs/function/bitwise/bitNot.js +5 -3
- package/lib/cjs/function/bitwise/bitOr.js +16 -60
- package/lib/cjs/function/bitwise/bitXor.js +17 -61
- package/lib/cjs/function/bitwise/leftShift.js +68 -81
- package/lib/cjs/function/bitwise/rightArithShift.js +68 -81
- package/lib/cjs/function/bitwise/rightLogShift.js +68 -81
- package/lib/cjs/function/bitwise/useMatrixForArrayScalar.js +36 -0
- package/lib/cjs/function/complex/arg.js +5 -3
- package/lib/cjs/function/complex/conj.js +6 -7
- package/lib/cjs/function/complex/im.js +7 -8
- package/lib/cjs/function/complex/re.js +6 -10
- package/lib/cjs/function/logical/and.js +74 -80
- package/lib/cjs/function/logical/not.js +13 -6
- package/lib/cjs/function/logical/or.js +21 -63
- package/lib/cjs/function/logical/xor.js +21 -63
- package/lib/cjs/function/matrix/diff.js +10 -7
- package/lib/cjs/function/matrix/eigs/complexEigs.js +5 -5
- package/lib/cjs/function/matrix/fft.js +2 -2
- package/lib/cjs/function/matrix/matrixFromColumns.js +1 -1
- package/lib/cjs/function/matrix/matrixFromRows.js +1 -1
- package/lib/cjs/function/matrix/ones.js +2 -1
- package/lib/cjs/function/matrix/sqrtm.js +3 -2
- package/lib/cjs/function/matrix/transpose.js +47 -48
- package/lib/cjs/function/matrix/zeros.js +2 -1
- package/lib/cjs/function/probability/factorial.js +5 -3
- package/lib/cjs/function/probability/gamma.js +38 -40
- package/lib/cjs/function/probability/kldivergence.js +5 -2
- package/lib/cjs/function/probability/lgamma.js +30 -30
- package/lib/cjs/function/probability/util/seededRNG.js +2 -2
- package/lib/cjs/function/relational/compare.js +21 -67
- package/lib/cjs/function/relational/compareNatural.js +59 -54
- package/lib/cjs/function/relational/compareText.js +10 -43
- package/lib/cjs/function/relational/compareUnits.js +24 -0
- package/lib/cjs/function/relational/equal.js +19 -80
- package/lib/cjs/function/relational/equalScalar.js +7 -9
- package/lib/cjs/function/relational/larger.js +21 -67
- package/lib/cjs/function/relational/largerEq.js +21 -67
- package/lib/cjs/function/relational/smaller.js +21 -67
- package/lib/cjs/function/relational/smallerEq.js +21 -67
- package/lib/cjs/function/relational/unequal.js +19 -80
- package/lib/cjs/function/special/erf.js +5 -3
- package/lib/cjs/function/statistics/std.js +11 -2
- package/lib/cjs/function/trigonometry/acos.js +4 -8
- package/lib/cjs/function/trigonometry/acosh.js +2 -7
- package/lib/cjs/function/trigonometry/acot.js +4 -8
- package/lib/cjs/function/trigonometry/acoth.js +4 -8
- package/lib/cjs/function/trigonometry/acsc.js +4 -8
- package/lib/cjs/function/trigonometry/acsch.js +4 -8
- package/lib/cjs/function/trigonometry/asec.js +4 -8
- package/lib/cjs/function/trigonometry/asech.js +4 -8
- package/lib/cjs/function/trigonometry/asin.js +4 -9
- package/lib/cjs/function/trigonometry/asinh.js +4 -9
- package/lib/cjs/function/trigonometry/atan.js +4 -9
- package/lib/cjs/function/trigonometry/atan2.js +24 -62
- package/lib/cjs/function/trigonometry/atanh.js +4 -9
- package/lib/cjs/function/trigonometry/cos.js +11 -20
- package/lib/cjs/function/trigonometry/cosh.js +5 -19
- package/lib/cjs/function/trigonometry/cot.js +9 -15
- package/lib/cjs/function/trigonometry/coth.js +4 -15
- package/lib/cjs/function/trigonometry/csc.js +11 -17
- package/lib/cjs/function/trigonometry/csch.js +4 -15
- package/lib/cjs/function/trigonometry/sec.js +11 -17
- package/lib/cjs/function/trigonometry/sech.js +4 -15
- package/lib/cjs/function/trigonometry/sin.js +11 -21
- package/lib/cjs/function/trigonometry/sinh.js +5 -20
- package/lib/cjs/function/trigonometry/tan.js +11 -21
- package/lib/cjs/function/trigonometry/tanh.js +5 -20
- package/lib/cjs/function/trigonometry/trigUnit.js +24 -0
- package/lib/cjs/function/unit/to.js +7 -41
- package/lib/cjs/function/utils/hasNumericValue.js +4 -0
- package/lib/cjs/function/utils/isInteger.js +5 -3
- package/lib/cjs/function/utils/isNegative.js +10 -6
- package/lib/cjs/function/utils/isNumeric.js +5 -3
- package/lib/cjs/function/utils/isPositive.js +10 -6
- package/lib/cjs/function/utils/isPrime.js +5 -3
- package/lib/cjs/function/utils/isZero.js +10 -6
- package/lib/cjs/function/utils/numeric.js +11 -4
- package/lib/cjs/function/utils/typeOf.js +38 -44
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/plain/bignumber/index.js +1 -1
- package/lib/cjs/type/bignumber/BigNumber.js +2 -2
- package/lib/cjs/type/bignumber/function/bignumber.js +6 -4
- package/lib/cjs/type/boolean.js +7 -5
- package/lib/cjs/type/chain/Chain.js +23 -3
- package/lib/cjs/type/complex/Complex.js +18 -14
- package/lib/cjs/type/complex/function/complex.js +6 -4
- package/lib/cjs/type/fraction/Fraction.js +10 -6
- package/lib/cjs/type/fraction/function/fraction.js +6 -4
- package/lib/cjs/type/matrix/DenseMatrix.js +21 -6
- package/lib/cjs/type/matrix/SparseMatrix.js +12 -2
- package/lib/cjs/type/matrix/utils/{algorithm01.js → matAlgo01xDSid.js} +4 -4
- package/lib/cjs/type/matrix/utils/{algorithm02.js → matAlgo02xDS0.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm03.js → matAlgo03xDSf.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm04.js → matAlgo04xSidSid.js} +7 -7
- package/lib/cjs/type/matrix/utils/{algorithm05.js → matAlgo05xSfSf.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm06.js → matAlgo06xS0S0.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm07.js → matAlgo07xSSf.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm08.js → matAlgo08xS0Sid.js} +6 -6
- package/lib/cjs/type/matrix/utils/{algorithm09.js → matAlgo09xS0Sf.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm10.js → matAlgo10xSids.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm11.js → matAlgo11xS0s.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm12.js → matAlgo12xSfs.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm13.js → matAlgo13xDD.js} +5 -5
- package/lib/cjs/type/matrix/utils/{algorithm14.js → matAlgo14xDs.js} +5 -5
- package/lib/cjs/type/matrix/utils/matrixAlgorithmSuite.js +238 -0
- package/lib/cjs/type/number.js +6 -4
- package/lib/cjs/type/string.js +7 -5
- package/lib/cjs/type/unit/Unit.js +69 -21
- package/lib/cjs/type/unit/function/createUnit.js +2 -1
- package/lib/cjs/type/unit/function/unit.js +9 -3
- package/lib/cjs/utils/customs.js +2 -2
- package/lib/cjs/utils/emitter.js +1 -1
- package/lib/cjs/utils/function.js +2 -2
- package/lib/cjs/utils/is.js +27 -25
- package/lib/cjs/utils/latex.js +3 -3
- package/lib/cjs/utils/lruQueue.js +1 -1
- package/lib/cjs/utils/map.js +3 -3
- package/lib/cjs/utils/object.js +2 -2
- package/lib/cjs/utils/snapshot.js +30 -57
- package/lib/cjs/utils/string.js +3 -3
- package/lib/cjs/version.js +1 -1
- package/lib/esm/core/create.js +2 -1
- package/lib/esm/core/function/import.js +2 -12
- package/lib/esm/core/function/typed.js +47 -11
- package/lib/esm/entry/dependenciesAny/dependenciesChainClass.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesKldivergence.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesResolve.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSimplifyConstant.generated.js +34 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSimplifyCore.generated.js +4 -0
- package/lib/esm/entry/dependenciesAny/dependenciesSqrtm.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesStd.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny/dependenciesStdTransform.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny.generated.js +1 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesChainClass.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesResolve.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesSimplifyConstant.generated.js +30 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesSimplifyCore.generated.js +4 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesStd.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesStdTransform.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber.generated.js +1 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +73 -48
- package/lib/esm/entry/impureFunctionsNumber.generated.js +81 -58
- package/lib/esm/entry/pureFunctionsAny.generated.js +39 -36
- package/lib/esm/entry/pureFunctionsNumber.generated.js +14 -13
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +2 -0
- package/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js +1 -1
- package/lib/esm/expression/node/AccessorNode.js +158 -153
- package/lib/esm/expression/node/ArrayNode.js +162 -154
- package/lib/esm/expression/node/AssignmentNode.js +257 -245
- package/lib/esm/expression/node/BlockNode.js +177 -163
- package/lib/esm/expression/node/ConditionalNode.js +197 -174
- package/lib/esm/expression/node/ConstantNode.js +171 -163
- package/lib/esm/expression/node/FunctionAssignmentNode.js +205 -180
- package/lib/esm/expression/node/FunctionNode.js +407 -407
- package/lib/esm/expression/node/IndexNode.js +206 -198
- package/lib/esm/expression/node/Node.js +325 -325
- package/lib/esm/expression/node/ObjectNode.js +166 -157
- package/lib/esm/expression/node/OperatorNode.js +414 -377
- package/lib/esm/expression/node/ParenthesisNode.js +146 -138
- package/lib/esm/expression/node/RangeNode.js +221 -212
- package/lib/esm/expression/node/RelationalNode.js +190 -176
- package/lib/esm/expression/node/SymbolNode.js +161 -152
- package/lib/esm/expression/operators.js +96 -4
- package/lib/esm/expression/parse.js +25 -7
- package/lib/esm/expression/transform/std.transform.js +3 -1
- package/lib/esm/factoriesAny.js +1 -0
- package/lib/esm/factoriesNumber.js +1 -0
- package/lib/esm/function/algebra/derivative.js +22 -30
- package/lib/esm/function/algebra/leafCount.js +0 -3
- package/lib/esm/function/algebra/rationalize.js +83 -114
- package/lib/esm/function/algebra/resolve.js +25 -16
- package/lib/esm/function/algebra/simplify.js +82 -112
- package/lib/esm/function/algebra/{simplify/simplifyConstant.js → simplifyConstant.js} +39 -9
- package/lib/esm/function/algebra/simplifyCore.js +192 -91
- package/lib/esm/function/algebra/symbolicEqual.js +9 -26
- package/lib/esm/function/arithmetic/abs.js +3 -16
- package/lib/esm/function/arithmetic/add.js +21 -65
- package/lib/esm/function/arithmetic/addScalar.js +11 -5
- package/lib/esm/function/arithmetic/cbrt.js +7 -10
- package/lib/esm/function/arithmetic/ceil.js +25 -25
- package/lib/esm/function/arithmetic/cube.js +5 -9
- package/lib/esm/function/arithmetic/divide.js +7 -7
- package/lib/esm/function/arithmetic/divideScalar.js +2 -19
- package/lib/esm/function/arithmetic/dotDivide.js +22 -64
- package/lib/esm/function/arithmetic/dotMultiply.js +16 -60
- package/lib/esm/function/arithmetic/dotPow.js +30 -62
- package/lib/esm/function/arithmetic/exp.js +8 -11
- package/lib/esm/function/arithmetic/expm1.js +10 -9
- package/lib/esm/function/arithmetic/fix.js +17 -17
- package/lib/esm/function/arithmetic/floor.js +25 -25
- package/lib/esm/function/arithmetic/gcd.js +26 -70
- package/lib/esm/function/arithmetic/hypot.js +7 -6
- package/lib/esm/function/arithmetic/lcm.js +26 -70
- package/lib/esm/function/arithmetic/log.js +7 -10
- package/lib/esm/function/arithmetic/log10.js +1 -3
- package/lib/esm/function/arithmetic/log1p.js +4 -6
- package/lib/esm/function/arithmetic/log2.js +1 -3
- package/lib/esm/function/arithmetic/mod.js +21 -62
- package/lib/esm/function/arithmetic/multiply.js +23 -27
- package/lib/esm/function/arithmetic/multiplyScalar.js +2 -13
- package/lib/esm/function/arithmetic/norm.js +0 -4
- package/lib/esm/function/arithmetic/nthRoot.js +38 -73
- package/lib/esm/function/arithmetic/round.js +26 -28
- package/lib/esm/function/arithmetic/sign.js +5 -7
- package/lib/esm/function/arithmetic/sqrt.js +5 -8
- package/lib/esm/function/arithmetic/square.js +6 -9
- package/lib/esm/function/arithmetic/subtract.js +31 -95
- package/lib/esm/function/arithmetic/unaryMinus.js +6 -16
- package/lib/esm/function/arithmetic/unaryPlus.js +2 -4
- package/lib/esm/function/bitwise/bitAnd.js +16 -59
- package/lib/esm/function/bitwise/bitNot.js +1 -3
- package/lib/esm/function/bitwise/bitOr.js +16 -59
- package/lib/esm/function/bitwise/bitXor.js +16 -59
- package/lib/esm/function/bitwise/leftShift.js +38 -60
- package/lib/esm/function/bitwise/rightArithShift.js +38 -60
- package/lib/esm/function/bitwise/rightLogShift.js +38 -60
- package/lib/esm/function/bitwise/useMatrixForArrayScalar.js +13 -0
- package/lib/esm/function/complex/arg.js +1 -3
- package/lib/esm/function/complex/conj.js +3 -12
- package/lib/esm/function/complex/im.js +4 -15
- package/lib/esm/function/complex/re.js +3 -15
- package/lib/esm/function/logical/and.js +35 -57
- package/lib/esm/function/logical/not.js +3 -6
- package/lib/esm/function/logical/or.js +16 -61
- package/lib/esm/function/logical/xor.js +16 -61
- package/lib/esm/function/matrix/diff.js +2 -7
- package/lib/esm/function/matrix/ones.js +2 -1
- package/lib/esm/function/matrix/sqrtm.js +3 -2
- package/lib/esm/function/matrix/transpose.js +47 -50
- package/lib/esm/function/matrix/zeros.js +2 -1
- package/lib/esm/function/probability/factorial.js +1 -3
- package/lib/esm/function/probability/gamma.js +38 -39
- package/lib/esm/function/probability/kldivergence.js +3 -2
- package/lib/esm/function/probability/lgamma.js +29 -29
- package/lib/esm/function/relational/compare.js +21 -67
- package/lib/esm/function/relational/compareNatural.js +54 -49
- package/lib/esm/function/relational/compareText.js +10 -42
- package/lib/esm/function/relational/compareUnits.js +15 -0
- package/lib/esm/function/relational/equal.js +19 -79
- package/lib/esm/function/relational/equalScalar.js +6 -9
- package/lib/esm/function/relational/larger.js +23 -73
- package/lib/esm/function/relational/largerEq.js +23 -73
- package/lib/esm/function/relational/smaller.js +23 -73
- package/lib/esm/function/relational/smallerEq.js +23 -73
- package/lib/esm/function/relational/unequal.js +19 -79
- package/lib/esm/function/special/erf.js +1 -3
- package/lib/esm/function/statistics/std.js +10 -2
- package/lib/esm/function/trigonometry/acos.js +4 -7
- package/lib/esm/function/trigonometry/acosh.js +2 -6
- package/lib/esm/function/trigonometry/acot.js +4 -7
- package/lib/esm/function/trigonometry/acoth.js +4 -7
- package/lib/esm/function/trigonometry/acsc.js +4 -7
- package/lib/esm/function/trigonometry/acsch.js +4 -7
- package/lib/esm/function/trigonometry/asec.js +4 -7
- package/lib/esm/function/trigonometry/asech.js +4 -7
- package/lib/esm/function/trigonometry/asin.js +4 -8
- package/lib/esm/function/trigonometry/asinh.js +4 -8
- package/lib/esm/function/trigonometry/atan.js +4 -8
- package/lib/esm/function/trigonometry/atan2.js +25 -64
- package/lib/esm/function/trigonometry/atanh.js +4 -8
- package/lib/esm/function/trigonometry/cos.js +11 -22
- package/lib/esm/function/trigonometry/cosh.js +5 -20
- package/lib/esm/function/trigonometry/cot.js +10 -20
- package/lib/esm/function/trigonometry/coth.js +6 -20
- package/lib/esm/function/trigonometry/csc.js +12 -22
- package/lib/esm/function/trigonometry/csch.js +6 -20
- package/lib/esm/function/trigonometry/sec.js +12 -22
- package/lib/esm/function/trigonometry/sech.js +6 -20
- package/lib/esm/function/trigonometry/sin.js +11 -23
- package/lib/esm/function/trigonometry/sinh.js +5 -21
- package/lib/esm/function/trigonometry/tan.js +11 -23
- package/lib/esm/function/trigonometry/tanh.js +5 -21
- package/lib/esm/function/trigonometry/trigUnit.js +15 -0
- package/lib/esm/function/unit/to.js +8 -43
- package/lib/esm/function/utils/hasNumericValue.js +2 -0
- package/lib/esm/function/utils/isInteger.js +1 -3
- package/lib/esm/function/utils/isNegative.js +2 -6
- package/lib/esm/function/utils/isNumeric.js +3 -9
- package/lib/esm/function/utils/isPositive.js +2 -6
- package/lib/esm/function/utils/isPrime.js +1 -3
- package/lib/esm/function/utils/isZero.js +2 -6
- package/lib/esm/function/utils/numeric.js +11 -4
- package/lib/esm/function/utils/typeOf.js +38 -44
- package/lib/esm/type/bignumber/function/bignumber.js +1 -3
- package/lib/esm/type/boolean.js +1 -3
- package/lib/esm/type/chain/Chain.js +23 -3
- package/lib/esm/type/complex/Complex.js +4 -0
- package/lib/esm/type/complex/function/complex.js +1 -3
- package/lib/esm/type/fraction/Fraction.js +4 -0
- package/lib/esm/type/fraction/function/fraction.js +1 -3
- package/lib/esm/type/matrix/DenseMatrix.js +15 -1
- package/lib/esm/type/matrix/SparseMatrix.js +9 -0
- package/lib/esm/type/matrix/utils/{algorithm01.js → matAlgo01xDSid.js} +2 -2
- package/lib/esm/type/matrix/utils/{algorithm02.js → matAlgo02xDS0.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm03.js → matAlgo03xDSf.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm04.js → matAlgo04xSidSid.js} +5 -5
- package/lib/esm/type/matrix/utils/{algorithm05.js → matAlgo05xSfSf.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm06.js → matAlgo06xS0S0.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm07.js → matAlgo07xSSf.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm08.js → matAlgo08xS0Sid.js} +4 -4
- package/lib/esm/type/matrix/utils/{algorithm09.js → matAlgo09xS0Sf.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm10.js → matAlgo10xSids.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm11.js → matAlgo11xS0s.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm12.js → matAlgo12xSfs.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm13.js → matAlgo13xDD.js} +3 -3
- package/lib/esm/type/matrix/utils/{algorithm14.js → matAlgo14xDs.js} +3 -3
- package/lib/esm/type/matrix/utils/matrixAlgorithmSuite.js +168 -0
- package/lib/esm/type/number.js +1 -3
- package/lib/esm/type/string.js +1 -3
- package/lib/esm/type/unit/Unit.js +61 -13
- package/lib/esm/type/unit/function/createUnit.js +2 -1
- package/lib/esm/type/unit/function/unit.js +5 -3
- package/lib/esm/utils/is.js +18 -18
- package/lib/esm/utils/snapshot.js +22 -48
- package/lib/esm/version.js +1 -1
- package/package.json +21 -24
- package/types/index.d.ts +202 -181
- package/types/index.ts +264 -57
- package/lib/cjs/utils/polyfills.js +0 -14
- package/lib/esm/utils/polyfills.js +0 -12
|
@@ -72,12 +72,7 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
72
72
|
this.units = u.units;
|
|
73
73
|
this.dimensions = u.dimensions;
|
|
74
74
|
} else {
|
|
75
|
-
this.units = [
|
|
76
|
-
unit: UNIT_NONE,
|
|
77
|
-
prefix: PREFIXES.NONE,
|
|
78
|
-
// link to a list with supported prefixes
|
|
79
|
-
power: 0
|
|
80
|
-
}];
|
|
75
|
+
this.units = [];
|
|
81
76
|
this.dimensions = [];
|
|
82
77
|
|
|
83
78
|
for (var i = 0; i < BASE_DIMENSIONS.length; i++) {
|
|
@@ -99,6 +94,10 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
99
94
|
*/
|
|
100
95
|
|
|
101
96
|
|
|
97
|
+
Object.defineProperty(Unit, 'name', {
|
|
98
|
+
value: 'Unit'
|
|
99
|
+
});
|
|
100
|
+
Unit.prototype.constructor = Unit;
|
|
102
101
|
Unit.prototype.type = 'Unit';
|
|
103
102
|
Unit.prototype.isUnit = true; // private variables and functions for the Unit parser
|
|
104
103
|
|
|
@@ -461,6 +460,17 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
461
460
|
|
|
462
461
|
return unit;
|
|
463
462
|
};
|
|
463
|
+
/**
|
|
464
|
+
* Return the type of the value of this unit
|
|
465
|
+
*
|
|
466
|
+
* @memberof Unit
|
|
467
|
+
* @ return {string} type of the value of the unit
|
|
468
|
+
*/
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
Unit.prototype.valueType = function () {
|
|
472
|
+
return typeOf(this.value);
|
|
473
|
+
};
|
|
464
474
|
/**
|
|
465
475
|
* Return whether the unit is derived (such as m/s, or cm^2, but not N)
|
|
466
476
|
* @memberof Unit
|
|
@@ -648,15 +658,16 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
648
658
|
return this.equalBase(other) && equal(this.value, other.value);
|
|
649
659
|
};
|
|
650
660
|
/**
|
|
651
|
-
* Multiply this unit with another one
|
|
661
|
+
* Multiply this unit with another one or with a scalar
|
|
652
662
|
* @memberof Unit
|
|
653
663
|
* @param {Unit} other
|
|
654
664
|
* @return {Unit} product of this unit and the other unit
|
|
655
665
|
*/
|
|
656
666
|
|
|
657
667
|
|
|
658
|
-
Unit.prototype.multiply = function (
|
|
668
|
+
Unit.prototype.multiply = function (_other) {
|
|
659
669
|
var res = this.clone();
|
|
670
|
+
var other = isUnit(_other) ? _other : new Unit(_other);
|
|
660
671
|
|
|
661
672
|
for (var i = 0; i < BASE_DIMENSIONS.length; i++) {
|
|
662
673
|
// Dimensions arrays may be of different lengths. Default to 0.
|
|
@@ -680,19 +691,35 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
680
691
|
res.value = null;
|
|
681
692
|
}
|
|
682
693
|
|
|
683
|
-
|
|
694
|
+
if (isUnit(_other)) {
|
|
695
|
+
res.skipAutomaticSimplification = false;
|
|
696
|
+
}
|
|
697
|
+
|
|
684
698
|
return getNumericIfUnitless(res);
|
|
685
699
|
};
|
|
700
|
+
/**
|
|
701
|
+
* Divide a number by this unit
|
|
702
|
+
*
|
|
703
|
+
* @memberof Unit
|
|
704
|
+
* @param {numeric} numerator
|
|
705
|
+
* @param {unit} result of dividing numerator by this unit
|
|
706
|
+
*/
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
Unit.prototype.divideInto = function (numerator) {
|
|
710
|
+
return new Unit(numerator).divide(this);
|
|
711
|
+
};
|
|
686
712
|
/**
|
|
687
713
|
* Divide this unit by another one
|
|
688
714
|
* @memberof Unit
|
|
689
|
-
* @param {Unit} other
|
|
715
|
+
* @param {Unit | numeric} other
|
|
690
716
|
* @return {Unit} result of dividing this unit by the other unit
|
|
691
717
|
*/
|
|
692
718
|
|
|
693
719
|
|
|
694
|
-
Unit.prototype.divide = function (
|
|
720
|
+
Unit.prototype.divide = function (_other) {
|
|
695
721
|
var res = this.clone();
|
|
722
|
+
var other = isUnit(_other) ? _other : new Unit(_other);
|
|
696
723
|
|
|
697
724
|
for (var i = 0; i < BASE_DIMENSIONS.length; i++) {
|
|
698
725
|
// Dimensions arrays may be of different lengths. Default to 0.
|
|
@@ -718,7 +745,10 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
718
745
|
res.value = null;
|
|
719
746
|
}
|
|
720
747
|
|
|
721
|
-
|
|
748
|
+
if (isUnit(_other)) {
|
|
749
|
+
res.skipAutomaticSimplification = false;
|
|
750
|
+
}
|
|
751
|
+
|
|
722
752
|
return getNumericIfUnitless(res);
|
|
723
753
|
};
|
|
724
754
|
/**
|
|
@@ -787,7 +817,7 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
787
817
|
// To give the correct, but unexpected, results for units with an offset.
|
|
788
818
|
// For example, abs(-283.15 degC) = -263.15 degC !!!
|
|
789
819
|
// We must take the offset into consideration here
|
|
790
|
-
var convert =
|
|
820
|
+
var convert = ret._numberConverter(); // convert to Fraction or BigNumber if needed
|
|
791
821
|
|
|
792
822
|
|
|
793
823
|
var unitValue = convert(ret.units[0].unit.value);
|
|
@@ -3627,6 +3657,23 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
3627
3657
|
return x;
|
|
3628
3658
|
}
|
|
3629
3659
|
};
|
|
3660
|
+
/**
|
|
3661
|
+
* Retrieve the right converter function corresponding with this unit's
|
|
3662
|
+
* value
|
|
3663
|
+
*
|
|
3664
|
+
* @memberof Unit
|
|
3665
|
+
* @return {Function}
|
|
3666
|
+
*/
|
|
3667
|
+
|
|
3668
|
+
Unit.prototype._numberConverter = function () {
|
|
3669
|
+
var convert = Unit.typeConverters[this.valueType()];
|
|
3670
|
+
|
|
3671
|
+
if (convert) {
|
|
3672
|
+
return convert;
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
throw new TypeError('Unsupported Unit value type "' + this.valueType() + '"');
|
|
3676
|
+
};
|
|
3630
3677
|
/**
|
|
3631
3678
|
* Retrieve the right convertor function corresponding with the type
|
|
3632
3679
|
* of provided exampleValue.
|
|
@@ -3636,6 +3683,7 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
3636
3683
|
* @return {Function}
|
|
3637
3684
|
*/
|
|
3638
3685
|
|
|
3686
|
+
|
|
3639
3687
|
Unit._getNumberConverter = function (type) {
|
|
3640
3688
|
if (!Unit.typeConverters[type]) {
|
|
3641
3689
|
throw new TypeError('Unsupported type "' + type + '"');
|
|
@@ -34,9 +34,10 @@ export var createCreateUnit = /* #__PURE__ */factory(name, dependencies, _ref =>
|
|
|
34
34
|
* math.createUnit('foo')
|
|
35
35
|
* math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']})
|
|
36
36
|
* math.createUnit('mph', '1 mile/hour')
|
|
37
|
+
* math.createUnit('km', math.unit(1000, 'm'))
|
|
37
38
|
*
|
|
38
39
|
* @param {string} name The name of the new unit. Must be unique. Example: 'knot'
|
|
39
|
-
* @param {string, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.
|
|
40
|
+
* @param {string, UnitDefinition, Unit} definition Definition of the unit in terms of existing units. For example, '0.514444444 m / s'.
|
|
40
41
|
* @param {Object} options (optional) An object containing any of the following properties:
|
|
41
42
|
* - `prefixes {string}` "none", "short", "long", "binary_short", or "binary_long". The default is "none".
|
|
42
43
|
* - `aliases {Array}` Array of strings. Example: ['knots', 'kt', 'kts']
|
|
@@ -48,8 +48,10 @@ export var createUnitFunction = /* #__PURE__ */factory(name, dependencies, _ref
|
|
|
48
48
|
'number | BigNumber | Fraction | Complex, string': function numberBigNumberFractionComplexString(value, unit) {
|
|
49
49
|
return new Unit(value, unit);
|
|
50
50
|
},
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
'number | BigNumber | Fraction': function numberBigNumberFraction(value) {
|
|
52
|
+
// dimensionless
|
|
53
|
+
return new Unit(value);
|
|
54
|
+
},
|
|
55
|
+
'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))
|
|
54
56
|
});
|
|
55
57
|
});
|
package/lib/esm/utils/is.js
CHANGED
|
@@ -111,6 +111,20 @@ export function isConditionalNode(x) {
|
|
|
111
111
|
export function isConstantNode(x) {
|
|
112
112
|
return x && x.isConstantNode === true && x.constructor.prototype.isNode === true || false;
|
|
113
113
|
}
|
|
114
|
+
/* Very specialized: returns true for those nodes which in the numerator of
|
|
115
|
+
a fraction means that the division in that fraction has precedence over implicit
|
|
116
|
+
multiplication, e.g. -2/3 x parses as (-2/3) x and 3/4 x parses as (3/4) x but
|
|
117
|
+
6!/8 x parses as 6! / (8x). It is located here because it is shared between
|
|
118
|
+
parse.js and OperatorNode.js (for parsing and printing, respectively).
|
|
119
|
+
|
|
120
|
+
This should *not* be exported from mathjs, unlike most of the tests here.
|
|
121
|
+
Its name does not start with 'is' to prevent utils/snapshot.js from thinking
|
|
122
|
+
it should be exported.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
export function rule2Node(node) {
|
|
126
|
+
return isConstantNode(node) || isOperatorNode(node) && node.args.length === 1 && isConstantNode(node.args[0]) && '-+~'.includes(node.op);
|
|
127
|
+
}
|
|
114
128
|
export function isFunctionAssignmentNode(x) {
|
|
115
129
|
return x && x.isFunctionAssignmentNode === true && x.constructor.prototype.isNode === true || false;
|
|
116
130
|
}
|
|
@@ -145,26 +159,12 @@ export function typeOf(x) {
|
|
|
145
159
|
var t = typeof x;
|
|
146
160
|
|
|
147
161
|
if (t === 'object') {
|
|
148
|
-
// JavaScript types
|
|
149
162
|
if (x === null) return 'null';
|
|
150
|
-
if (
|
|
151
|
-
if (x instanceof Date) return 'Date';
|
|
152
|
-
if (x instanceof RegExp) return 'RegExp'; // math.js types
|
|
163
|
+
if (isBigNumber(x)) return 'BigNumber'; // Special: weird mashup with Decimal
|
|
153
164
|
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
if (isFraction(x)) return 'Fraction';
|
|
157
|
-
if (isMatrix(x)) return 'Matrix';
|
|
158
|
-
if (isUnit(x)) return 'Unit';
|
|
159
|
-
if (isIndex(x)) return 'Index';
|
|
160
|
-
if (isRange(x)) return 'Range';
|
|
161
|
-
if (isResultSet(x)) return 'ResultSet';
|
|
162
|
-
if (isNode(x)) return x.type;
|
|
163
|
-
if (isChain(x)) return 'Chain';
|
|
164
|
-
if (isHelp(x)) return 'Help';
|
|
165
|
-
return 'Object';
|
|
165
|
+
if (x.constructor && x.constructor.name) return x.constructor.name;
|
|
166
|
+
return 'Object'; // just in case
|
|
166
167
|
}
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
return t; // can be 'string', 'number', 'boolean', ...
|
|
169
|
+
return t; // can be 'string', 'number', 'boolean', 'function', 'bigint', ...
|
|
170
170
|
}
|
|
@@ -16,6 +16,7 @@ import assert from 'assert';
|
|
|
16
16
|
import * as allIsFunctions from './is.js';
|
|
17
17
|
import { create } from '../core/create.js';
|
|
18
18
|
import { endsWith } from './string.js';
|
|
19
|
+
export var validateTypeOf = allIsFunctions.typeOf;
|
|
19
20
|
export function validateBundle(expectedBundleStructure, bundle) {
|
|
20
21
|
var originalWarn = console.warn;
|
|
21
22
|
|
|
@@ -110,21 +111,21 @@ export function createSnapshotFromFactories(factories) {
|
|
|
110
111
|
var factory = factories[factoryName];
|
|
111
112
|
var name = factory.fn;
|
|
112
113
|
var isTransformFunction = factory.meta && factory.meta.isTransformFunction;
|
|
113
|
-
var isClass = !isLowerCase(name[0]) && validateTypeOf(math[name]) === '
|
|
114
|
+
var isClass = !isLowerCase(name[0]) && validateTypeOf(math[name]) === 'function';
|
|
114
115
|
var dependenciesName = factory.fn + (isTransformFunction ? 'Transform' : '') + 'Dependencies';
|
|
115
|
-
allFactoryFunctions[factoryName] = '
|
|
116
|
+
allFactoryFunctions[factoryName] = 'function';
|
|
116
117
|
allFunctionsConstantsClasses[name] = validateTypeOf(math[name]);
|
|
117
118
|
allDependencyCollections[dependenciesName] = 'Object';
|
|
118
119
|
|
|
119
120
|
if (isTransformFunction) {
|
|
120
|
-
allTransformFunctions[name] = '
|
|
121
|
+
allTransformFunctions[name] = 'function';
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
if (isClass) {
|
|
124
125
|
if (endsWith(name, 'Node')) {
|
|
125
|
-
allNodeClasses[name] = '
|
|
126
|
+
allNodeClasses[name] = 'function';
|
|
126
127
|
} else {
|
|
127
|
-
allClasses[name] = '
|
|
128
|
+
allClasses[name] = 'function';
|
|
128
129
|
}
|
|
129
130
|
} else {
|
|
130
131
|
allFunctionsConstants[name] = validateTypeOf(math[name]);
|
|
@@ -144,37 +145,37 @@ export function createSnapshotFromFactories(factories) {
|
|
|
144
145
|
var allTypeChecks = {};
|
|
145
146
|
Object.keys(allIsFunctions).forEach(name => {
|
|
146
147
|
if (name.indexOf('is') === 0) {
|
|
147
|
-
allTypeChecks[name] = '
|
|
148
|
+
allTypeChecks[name] = 'function';
|
|
148
149
|
}
|
|
149
150
|
});
|
|
150
151
|
var allErrorClasses = {
|
|
151
|
-
ArgumentsError: '
|
|
152
|
-
DimensionError: '
|
|
153
|
-
IndexError: '
|
|
152
|
+
ArgumentsError: 'function',
|
|
153
|
+
DimensionError: 'function',
|
|
154
|
+
IndexError: 'function'
|
|
154
155
|
};
|
|
155
156
|
|
|
156
157
|
var expectedInstanceStructure = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, allFunctionsConstantsClasses), {}, {
|
|
157
|
-
on: '
|
|
158
|
-
off: '
|
|
159
|
-
once: '
|
|
160
|
-
emit: '
|
|
161
|
-
import: '
|
|
162
|
-
config: '
|
|
163
|
-
create: '
|
|
164
|
-
factory: '
|
|
158
|
+
on: 'function',
|
|
159
|
+
off: 'function',
|
|
160
|
+
once: 'function',
|
|
161
|
+
emit: 'function',
|
|
162
|
+
import: 'function',
|
|
163
|
+
config: 'function',
|
|
164
|
+
create: 'function',
|
|
165
|
+
factory: 'function'
|
|
165
166
|
}, allTypeChecks), allErrorClasses), {}, {
|
|
166
167
|
expression: {
|
|
167
168
|
transform: _objectSpread({}, allTransformFunctions),
|
|
168
169
|
mathWithTransform: _objectSpread(_objectSpread({}, exclude(allFunctionsConstants, ['chain'])), {}, {
|
|
169
|
-
config: '
|
|
170
|
+
config: 'function'
|
|
170
171
|
})
|
|
171
172
|
}
|
|
172
173
|
});
|
|
173
174
|
|
|
174
175
|
var expectedES6Structure = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, exclude(allFunctionsConstantsClasses, ['E', 'false', 'Infinity', 'NaN', 'null', 'PI', 'true'])), {}, {
|
|
175
|
-
create: '
|
|
176
|
-
config: '
|
|
177
|
-
factory: '
|
|
176
|
+
create: 'function',
|
|
177
|
+
config: 'function',
|
|
178
|
+
factory: 'function',
|
|
178
179
|
_true: 'boolean',
|
|
179
180
|
_false: 'boolean',
|
|
180
181
|
_null: 'null',
|
|
@@ -189,33 +190,6 @@ export function createSnapshotFromFactories(factories) {
|
|
|
189
190
|
expectedES6Structure
|
|
190
191
|
};
|
|
191
192
|
}
|
|
192
|
-
export function validateTypeOf(x) {
|
|
193
|
-
if (x && x.type === 'Unit') {
|
|
194
|
-
return 'Unit';
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (x && x.type === 'Complex') {
|
|
198
|
-
return 'Complex';
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
if (Array.isArray(x)) {
|
|
202
|
-
return 'Array';
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if (x === null) {
|
|
206
|
-
return 'null';
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
if (typeof x === 'function') {
|
|
210
|
-
return 'Function';
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (typeof x === 'object') {
|
|
214
|
-
return 'Object';
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return typeof x;
|
|
218
|
-
}
|
|
219
193
|
|
|
220
194
|
function traverse(obj) {
|
|
221
195
|
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (value, path) => {};
|
package/lib/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var version = '
|
|
1
|
+
export var version = '11.0.0'; // Note: This file is automatically generated when building math.js.
|
|
2
2
|
// Changes made in this file will be overwritten.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mathjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices.",
|
|
5
5
|
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
|
|
6
6
|
"homepage": "https://mathjs.org",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"unit"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@babel/runtime": "^7.18.
|
|
28
|
+
"@babel/runtime": "^7.18.9",
|
|
29
29
|
"complex.js": "^2.1.1",
|
|
30
30
|
"decimal.js": "^10.3.1",
|
|
31
31
|
"escape-latex": "^1.2.0",
|
|
@@ -33,37 +33,37 @@
|
|
|
33
33
|
"javascript-natural-sort": "^0.7.1",
|
|
34
34
|
"seedrandom": "^3.0.5",
|
|
35
35
|
"tiny-emitter": "^2.1.0",
|
|
36
|
-
"typed-function": "^
|
|
36
|
+
"typed-function": "^3.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "7.18.
|
|
40
|
-
"@babel/plugin-transform-object-assign": "7.
|
|
41
|
-
"@babel/plugin-transform-runtime": "7.18.
|
|
42
|
-
"@babel/preset-env": "7.18.
|
|
43
|
-
"@babel/register": "7.
|
|
39
|
+
"@babel/core": "7.18.9",
|
|
40
|
+
"@babel/plugin-transform-object-assign": "7.18.6",
|
|
41
|
+
"@babel/plugin-transform-runtime": "7.18.9",
|
|
42
|
+
"@babel/preset-env": "7.18.9",
|
|
43
|
+
"@babel/register": "7.18.9",
|
|
44
44
|
"@types/assert": "1.5.6",
|
|
45
45
|
"@types/mocha": "9.1.1",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
47
|
-
"@typescript-eslint/parser": "5.
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "5.30.7",
|
|
47
|
+
"@typescript-eslint/parser": "5.30.7",
|
|
48
48
|
"assert": "2.0.0",
|
|
49
49
|
"babel-loader": "8.2.5",
|
|
50
50
|
"benchmark": "2.1.4",
|
|
51
51
|
"codecov": "3.8.3",
|
|
52
|
-
"core-js": "3.23.
|
|
52
|
+
"core-js": "3.23.5",
|
|
53
53
|
"del": "6.1.1",
|
|
54
54
|
"dtslint": "4.2.1",
|
|
55
|
-
"eslint": "8.
|
|
55
|
+
"eslint": "8.20.0",
|
|
56
56
|
"eslint-config-prettier": "8.5.0",
|
|
57
57
|
"eslint-config-standard": "17.0.0",
|
|
58
58
|
"eslint-plugin-import": "2.26.0",
|
|
59
|
-
"eslint-plugin-mocha": "10.0
|
|
60
|
-
"eslint-plugin-n": "15.2.
|
|
61
|
-
"eslint-plugin-prettier": "4.
|
|
59
|
+
"eslint-plugin-mocha": "10.1.0",
|
|
60
|
+
"eslint-plugin-n": "15.2.4",
|
|
61
|
+
"eslint-plugin-prettier": "4.2.1",
|
|
62
62
|
"eslint-plugin-promise": "6.0.0",
|
|
63
63
|
"expect-type": "0.13.0",
|
|
64
64
|
"expr-eval": "2.0.2",
|
|
65
65
|
"fancy-log": "2.0.0",
|
|
66
|
-
"glob": "
|
|
66
|
+
"glob": "8.0.3",
|
|
67
67
|
"gulp": "4.0.2",
|
|
68
68
|
"gulp-babel": "8.0.0",
|
|
69
69
|
"handlebars": "4.7.7",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"karma-firefox-launcher": "2.1.2",
|
|
75
75
|
"karma-mocha": "2.0.1",
|
|
76
76
|
"karma-mocha-reporter": "2.2.5",
|
|
77
|
-
"karma-webpack": "
|
|
78
|
-
"math-expression-evaluator": "1.
|
|
77
|
+
"karma-webpack": "5.0.0",
|
|
78
|
+
"math-expression-evaluator": "1.4.0",
|
|
79
79
|
"mkdirp": "1.0.4",
|
|
80
|
-
"mocha": "
|
|
80
|
+
"mocha": "10.0.0",
|
|
81
81
|
"ndarray": "1.0.19",
|
|
82
82
|
"ndarray-determinant": "1.0.0",
|
|
83
83
|
"ndarray-gemm": "1.0.0",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"prettier": "2.7.1",
|
|
90
90
|
"process": "0.11.10",
|
|
91
91
|
"sylvester": "0.0.21",
|
|
92
|
-
"ts-node": "10.
|
|
92
|
+
"ts-node": "10.9.1",
|
|
93
93
|
"typescript": "4.7.4",
|
|
94
|
-
"webpack": "
|
|
94
|
+
"webpack": "5.73.0",
|
|
95
95
|
"zeros": "1.0.0"
|
|
96
96
|
},
|
|
97
97
|
"type": "module",
|
|
@@ -176,8 +176,5 @@
|
|
|
176
176
|
"bugs": {
|
|
177
177
|
"url": "https://github.com/josdejong/mathjs/issues"
|
|
178
178
|
},
|
|
179
|
-
"browserslist": [
|
|
180
|
-
"IE 11"
|
|
181
|
-
],
|
|
182
179
|
"sideEffects": false
|
|
183
180
|
}
|