mathjs 9.5.0 → 10.0.1
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 +33 -0
- package/bin/cli.js +0 -0
- package/docs/reference/functions/format.md +5 -2
- package/docs/reference/functions/parser.md +4 -4
- package/examples/expressions.js +1 -1
- package/lib/browser/math.js +5 -5
- package/lib/browser/math.js.map +1 -1
- package/lib/cjs/constants.js +1 -1
- package/lib/cjs/core/function/config.js +1 -1
- package/lib/cjs/core/function/import.js +2 -1
- package/lib/cjs/entry/dependenciesAny.generated.js +999 -999
- package/lib/cjs/entry/dependenciesNumber.generated.js +581 -581
- package/lib/cjs/entry/impureFunctionsAny.generated.js +314 -313
- package/lib/cjs/entry/impureFunctionsNumber.generated.js +223 -222
- package/lib/cjs/entry/mainAny.js +8 -8
- package/lib/cjs/entry/mainNumber.js +8 -8
- package/lib/cjs/entry/pureFunctionsAny.generated.js +1100 -1100
- package/lib/cjs/entry/pureFunctionsNumber.generated.js +375 -375
- package/lib/cjs/entry/typeChecks.js +12 -12
- package/lib/cjs/expression/Parser.js +1 -1
- package/lib/cjs/expression/function/parser.js +4 -4
- package/lib/cjs/expression/operators.js +1 -1
- package/lib/cjs/factoriesAny.js +660 -660
- package/lib/cjs/factoriesNumber.js +268 -237
- package/lib/cjs/function/probability/gamma.js +28 -30
- package/lib/cjs/function/string/format.js +5 -2
- package/lib/cjs/header.js +2 -2
- package/lib/cjs/plain/bignumber/arithmetic.js +2 -2
- package/lib/cjs/plain/number/arithmetic.js +10 -10
- package/lib/cjs/plain/number/constants.js +1 -1
- package/lib/cjs/plain/number/logical.js +1 -1
- package/lib/cjs/plain/number/probability.js +2 -1
- package/lib/cjs/plain/number/trigonometry.js +1 -1
- package/lib/cjs/plain/number/utils.js +1 -1
- package/lib/cjs/type/unit/physicalConstants.js +1 -1
- package/lib/cjs/utils/array.js +14 -14
- package/lib/cjs/utils/bignumber/bitwise.js +1 -1
- package/lib/cjs/utils/customs.js +5 -5
- package/lib/cjs/utils/factory.js +3 -3
- package/lib/cjs/utils/function.js +1 -1
- package/lib/cjs/utils/is.js +23 -23
- package/lib/cjs/utils/latex.js +2 -1
- package/lib/cjs/utils/map.js +3 -3
- package/lib/cjs/utils/noop.js +1 -1
- package/lib/cjs/utils/number.js +10 -6
- package/lib/cjs/utils/object.js +8 -8
- package/lib/cjs/utils/snapshot.js +1 -1
- package/lib/cjs/utils/string.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/core/function/import.js +2 -1
- package/lib/esm/entry/dependenciesAny.generated.js +270 -270
- package/lib/esm/entry/dependenciesNumber.generated.js +163 -163
- package/lib/esm/entry/impureFunctionsAny.generated.js +301 -301
- package/lib/esm/entry/impureFunctionsNumber.generated.js +211 -211
- package/lib/esm/entry/pureFunctionsAny.generated.js +816 -816
- package/lib/esm/entry/pureFunctionsNumber.generated.js +234 -234
- package/lib/esm/expression/Parser.js +1 -1
- package/lib/esm/expression/function/parser.js +4 -4
- package/lib/esm/function/probability/gamma.js +28 -30
- package/lib/esm/function/string/format.js +5 -2
- package/lib/esm/version.js +1 -1
- package/package.json +16 -16
- package/types/index.d.ts +273 -69
package/HISTORY.md
CHANGED
@@ -1,5 +1,38 @@
|
|
1
1
|
# History
|
2
2
|
|
3
|
+
# 2021-12-22, version 10.0.1
|
4
|
+
|
5
|
+
- Fix #1681: function `gamma` giving inaccurate complex results in some cases.
|
6
|
+
Thanks @kmdrGroch.
|
7
|
+
- Fixed a typo in an example, see #2366. Thanks @blackwindforce.
|
8
|
+
|
9
|
+
|
10
|
+
# 2021-11-03, version 10.0.0
|
11
|
+
|
12
|
+
!!! BE CAREFUL: BREAKING CHANGES IN THE TYPESCRIPT DEFINITIONS !!!
|
13
|
+
|
14
|
+
- Improvements to the Typescript typings (commit fc5c202e).
|
15
|
+
Thanks @joshhansen. First introduced in v9.5.1, but reverted because
|
16
|
+
it contains breaking changes.
|
17
|
+
|
18
|
+
Breaking changes: interface `MathNode` is now renamed to `MathNodeCommon`
|
19
|
+
and the related interfaces are structured in a different way.
|
20
|
+
|
21
|
+
- Fixed a typo in the TypeScript definition of toHTML. Thanks @TheToto.
|
22
|
+
|
23
|
+
|
24
|
+
# 2021-11-03, version 9.5.2`
|
25
|
+
|
26
|
+
- Revert the improvements to the Typescript typings because they contain
|
27
|
+
breaking changes. The improvements will be published in v10.0.0. See #2339.
|
28
|
+
|
29
|
+
|
30
|
+
# 2021-10-13, version 9.5.1
|
31
|
+
|
32
|
+
- Various improvements to the Typescript typings.
|
33
|
+
Thanks @joshhansen and @DianaTdr.
|
34
|
+
|
35
|
+
|
3
36
|
# 2021-09-22, version 9.5.0
|
4
37
|
|
5
38
|
- Implemented support for calculations with percentage, see #2303.
|
package/bin/cli.js
CHANGED
File without changes
|
@@ -49,8 +49,11 @@ math.format(value, callback)
|
|
49
49
|
For example format(-1, {notation: 'hex', wordSize: 8}) === '0xffi8'.
|
50
50
|
Default value is undefined.
|
51
51
|
- `precision: number`
|
52
|
-
|
53
|
-
|
52
|
+
Limit the number of digits of the formatted value.
|
53
|
+
For regular numbers, must be a number between 0 and 16.
|
54
|
+
For bignumbers, the maximum depends on the configured precision,
|
55
|
+
see function `config()`.
|
56
|
+
In case of notations 'exponential', 'engineering', and 'auto', `precision`
|
54
57
|
defines the total number of significant digits returned.
|
55
58
|
In case of notation 'fixed', `precision` defines the number of
|
56
59
|
significant digits after the decimal point.
|
@@ -36,10 +36,10 @@ const c = parser.evaluate('2 inch in cm') // 5.08 cm
|
|
36
36
|
const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476
|
37
37
|
|
38
38
|
// define variables and functions
|
39
|
-
parser.evaluate('x = 7 / 2')
|
40
|
-
parser.evaluate('x + 3')
|
41
|
-
parser.evaluate('
|
42
|
-
parser.evaluate('f(2, 3)')
|
39
|
+
parser.evaluate('x = 7 / 2') // 3.5
|
40
|
+
parser.evaluate('x + 3') // 6.5
|
41
|
+
parser.evaluate('f(x, y) = x^y') // f(x, y)
|
42
|
+
parser.evaluate('f(2, 3)') // 8
|
43
43
|
|
44
44
|
// get and set variables and functions
|
45
45
|
const x = parser.get('x') // 7
|
package/examples/expressions.js
CHANGED