mathjs 10.4.3 → 10.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +15 -0
- package/docs/reference/functions/lgamma.md +46 -0
- package/docs/reference/functions/pinv.md +44 -0
- package/docs/reference/functions/pow.md +8 -2
- package/docs/reference/functions.md +2 -0
- package/lib/browser/math.js +6 -6
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/entry/dependenciesAny/dependenciesDet.generated.js +5 -2
- package/lib/cjs/entry/dependenciesAny/dependenciesLgamma.generated.js +23 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesPinv.generated.js +53 -0
- package/lib/cjs/entry/dependenciesAny/dependenciesPow.generated.js +3 -0
- package/lib/cjs/entry/dependenciesAny.generated.js +16 -0
- package/lib/cjs/entry/dependenciesNumber/dependenciesLgamma.generated.js +20 -0
- package/lib/cjs/entry/dependenciesNumber.generated.js +8 -0
- package/lib/cjs/entry/impureFunctionsAny.generated.js +96 -94
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +5 -4
- package/lib/cjs/entry/pureFunctionsAny.generated.js +215 -193
- package/lib/cjs/entry/pureFunctionsNumber.generated.js +14 -10
- package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +6 -0
- package/lib/cjs/expression/embeddedDocs/function/arithmetic/pow.js +1 -1
- package/lib/cjs/expression/embeddedDocs/function/matrix/pinv.js +15 -0
- package/lib/cjs/expression/embeddedDocs/function/probability/lgamma.js +15 -0
- package/lib/cjs/factoriesAny.js +16 -0
- package/lib/cjs/factoriesNumber.js +3 -1
- package/lib/cjs/function/arithmetic/pow.js +25 -6
- package/lib/cjs/function/matrix/det.js +37 -31
- package/lib/cjs/function/matrix/pinv.js +223 -0
- package/lib/cjs/function/probability/lgamma.js +146 -0
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/plain/number/probability.js +43 -3
- package/lib/cjs/utils/latex.js +6 -0
- package/lib/cjs/utils/number.js +17 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/entry/dependenciesAny/dependenciesDet.generated.js +4 -2
- package/lib/esm/entry/dependenciesAny/dependenciesLgamma.generated.js +12 -0
- package/lib/esm/entry/dependenciesAny/dependenciesPinv.generated.js +32 -0
- package/lib/esm/entry/dependenciesAny/dependenciesPow.generated.js +2 -0
- package/lib/esm/entry/dependenciesAny.generated.js +2 -0
- package/lib/esm/entry/dependenciesNumber/dependenciesLgamma.generated.js +10 -0
- package/lib/esm/entry/dependenciesNumber.generated.js +1 -0
- package/lib/esm/entry/impureFunctionsAny.generated.js +90 -88
- package/lib/esm/entry/impureFunctionsNumber.generated.js +6 -5
- package/lib/esm/entry/pureFunctionsAny.generated.js +179 -159
- package/lib/esm/entry/pureFunctionsNumber.generated.js +8 -5
- package/lib/esm/expression/embeddedDocs/embeddedDocs.js +4 -0
- package/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js +1 -1
- package/lib/esm/expression/embeddedDocs/function/matrix/pinv.js +8 -0
- package/lib/esm/expression/embeddedDocs/function/probability/lgamma.js +8 -0
- package/lib/esm/factoriesAny.js +2 -0
- package/lib/esm/factoriesNumber.js +2 -1
- package/lib/esm/function/arithmetic/pow.js +25 -6
- package/lib/esm/function/matrix/det.js +35 -31
- package/lib/esm/function/matrix/pinv.js +205 -0
- package/lib/esm/function/probability/lgamma.js +137 -0
- package/lib/esm/plain/number/probability.js +33 -1
- package/lib/esm/utils/latex.js +6 -0
- package/lib/esm/utils/number.js +13 -1
- package/lib/esm/version.js +1 -1
- package/package.json +7 -7
- package/types/index.d.ts +22 -1
- package/types/index.ts +10 -0
package/types/index.d.ts
CHANGED
@@ -811,7 +811,21 @@ declare namespace math {
|
|
811
811
|
ceil(x: Complex): Complex;
|
812
812
|
ceil(x: MathArray): MathArray;
|
813
813
|
ceil(x: Matrix): Matrix;
|
814
|
-
|
814
|
+
|
815
|
+
/**
|
816
|
+
* Round a value towards plus infinity If x is complex, both real and
|
817
|
+
* imaginary part are rounded towards plus infinity. For matrices, the
|
818
|
+
* function is evaluated element wise.
|
819
|
+
* @param x Number to be rounded
|
820
|
+
* @param n Number of decimals Default value: 0.
|
821
|
+
* @returns Rounded value
|
822
|
+
*/
|
823
|
+
ceil(x: number, n: number | MathArray): number;
|
824
|
+
ceil(x: BigNumber, n: BigNumber | MathArray): BigNumber;
|
825
|
+
ceil(x: Fraction, n: number): Fraction;
|
826
|
+
ceil(x: Complex, n: number | MathArray): Complex;
|
827
|
+
ceil(x: MathArray, n: number): MathArray;
|
828
|
+
ceil(x: Matrix, n: number | BigNumber): Matrix;
|
815
829
|
|
816
830
|
/**
|
817
831
|
* Compute the cube of a value, x * x * x. For matrices, the function is
|
@@ -1818,6 +1832,13 @@ declare namespace math {
|
|
1818
1832
|
*/
|
1819
1833
|
kldivergence(q: MathArray | Matrix, p: MathArray | Matrix): number;
|
1820
1834
|
|
1835
|
+
/**
|
1836
|
+
* Compute the log gamma function of a value, using Lanczos approximation for numbers and Stirling series for complex numbers.
|
1837
|
+
* @param n A real or complex number
|
1838
|
+
* @returns The log gamma of `n`
|
1839
|
+
*/
|
1840
|
+
lgamma<T extends number | Complex>(n: T): NoLiteralType<T>;
|
1841
|
+
|
1821
1842
|
/**
|
1822
1843
|
* Multinomial Coefficients compute the number of ways of picking a1,
|
1823
1844
|
* a2, ..., ai unordered outcomes from n possibilities. multinomial
|
package/types/index.ts
CHANGED
@@ -831,3 +831,13 @@ Factory Test
|
|
831
831
|
expectTypeOf(x).toMatchTypeOf<math.MathJsChain>()
|
832
832
|
}
|
833
833
|
}
|
834
|
+
|
835
|
+
/*
|
836
|
+
Probability function examples
|
837
|
+
*/
|
838
|
+
{
|
839
|
+
const math = create(all, {});
|
840
|
+
|
841
|
+
expectTypeOf(math.lgamma(1.5)).toMatchTypeOf<number>()
|
842
|
+
expectTypeOf(math.lgamma(math.complex(1.5, -1.5))).toMatchTypeOf<math.Complex>()
|
843
|
+
}
|