mathjs 9.5.2 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/HISTORY.md +15 -1
- package/lib/browser/math.js +4 -4
- 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/operators.js +1 -1
- package/lib/cjs/factoriesAny.js +660 -660
- package/lib/cjs/factoriesNumber.js +268 -237
- package/lib/cjs/header.js +1 -1
- 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/version.js +1 -1
- package/package.json +16 -16
- package/types/index.d.ts +250 -71
@@ -5,9 +5,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
5
5
|
* DON'T MAKE CHANGES HERE
|
6
6
|
*/
|
7
7
|
import { config } from './configReadonly.js';
|
8
|
-
import { createChainClass, createChain, createNode,
|
9
|
-
import {
|
10
|
-
tau,
|
8
|
+
import { createChainClass, createReviver, createChain, createNode, createObjectNode, createRangeNode, createRelationalNode, createSymbolNode, createAccessorNode, createAssignmentNode, createConditionalNode, createFunctionNode, createIndexNode, createOperatorNode, createConstantNode, createFunctionAssignmentNode, createParenthesisNode, createBlockNode, createArrayNode, createParse, createSimplify, createCompile, createEvaluate, createHelpClass, createParserClass, createDerivative, createRationalize, createHelp, createParser, createApplyTransform, createFilterTransform, createForEachTransform, createMapTransform, createMeanTransform, createSubsetTransform, createStdTransform, createSumTransform, createMaxTransform, createMinTransform, createRangeTransform, createVarianceTransform } from '../factoriesNumber.js';
|
9
|
+
import { e, _false, index, _Infinity, LN10, LOG10E, matrix, _NaN, _null, phi, Range, replacer, SQRT1_2, // eslint-disable-line camelcase
|
10
|
+
subset, tau, typed, unaryPlus, version, xor, abs, acos, acot, acsc, add, and, asec, asin, atan, atanh, bitAnd, bitOr, boolean, cbrt, combinations, compare, compareText, cos, cot, csc, cube, divide, equalScalar, erf, exp, filter, fix, forEach, format, gamma, isInteger, isNegative, isPositive, isZero, LOG2E, largerEq, leftShift, log10, log2, map, mean, mod, multiply, not, number, or, pi, pow, random, rightArithShift, round, sec, sign, sin, size, smallerEq, square, string, subtract, tanh, typeOf, unequal, xgcd, acoth, addScalar, asech, bitNot, ceil, combinationsWithRep, cosh, csch, divideScalar, equalText, expm1, isNumeric, LN2, lcm, log1p, multiplyScalar, nthRoot, pickRandom, randomInt, ResultSet, SQRT2, sinh, sqrt, tan, unaryMinus, acosh, apply, asinh, bitXor, catalan, compareNatural, equal, factorial, hasNumericValue, isNaN, larger, mode, norm, partitionSelect, print, quantileSeq, rightLogShift, smaller, stirlingS2, _true, variance, acsch, atan2, composition, deepEqual, floor, hypot, log, median, multinomial, permutations, range, sech, std, clone, coth, gcd, isPrime, numeric, prod, bellNumbers, mad, sum, max, min } from './pureFunctionsNumber.generated.js';
|
11
11
|
var math = {}; // NOT pure!
|
12
12
|
|
13
13
|
var mathWithTransform = {}; // NOT pure!
|
@@ -17,6 +17,9 @@ var classes = {}; // NOT pure!
|
|
17
17
|
export var Chain = createChainClass({
|
18
18
|
math
|
19
19
|
});
|
20
|
+
export var reviver = createReviver({
|
21
|
+
classes
|
22
|
+
});
|
20
23
|
export var chain = createChain({
|
21
24
|
Chain,
|
22
25
|
typed
|
@@ -24,35 +27,15 @@ export var chain = createChain({
|
|
24
27
|
export var Node = createNode({
|
25
28
|
mathWithTransform
|
26
29
|
});
|
27
|
-
export var ArrayNode = createArrayNode({
|
28
|
-
Node
|
29
|
-
});
|
30
|
-
export var ConditionalNode = createConditionalNode({
|
31
|
-
Node
|
32
|
-
});
|
33
|
-
export var FunctionAssignmentNode = createFunctionAssignmentNode({
|
34
|
-
Node,
|
35
|
-
typed
|
36
|
-
});
|
37
30
|
export var ObjectNode = createObjectNode({
|
38
31
|
Node
|
39
32
|
});
|
40
|
-
export var
|
33
|
+
export var RangeNode = createRangeNode({
|
41
34
|
Node
|
42
35
|
});
|
43
36
|
export var RelationalNode = createRelationalNode({
|
44
37
|
Node
|
45
38
|
});
|
46
|
-
export var reviver = createReviver({
|
47
|
-
classes
|
48
|
-
});
|
49
|
-
export var BlockNode = createBlockNode({
|
50
|
-
Node,
|
51
|
-
ResultSet
|
52
|
-
});
|
53
|
-
export var OperatorNode = createOperatorNode({
|
54
|
-
Node
|
55
|
-
});
|
56
39
|
export var SymbolNode = createSymbolNode({
|
57
40
|
Node,
|
58
41
|
math
|
@@ -61,17 +44,14 @@ export var AccessorNode = createAccessorNode({
|
|
61
44
|
Node,
|
62
45
|
subset
|
63
46
|
});
|
64
|
-
export var ConstantNode = createConstantNode({
|
65
|
-
Node
|
66
|
-
});
|
67
|
-
export var RangeNode = createRangeNode({
|
68
|
-
Node
|
69
|
-
});
|
70
47
|
export var AssignmentNode = createAssignmentNode({
|
71
48
|
matrix,
|
72
49
|
Node,
|
73
50
|
subset
|
74
51
|
});
|
52
|
+
export var ConditionalNode = createConditionalNode({
|
53
|
+
Node
|
54
|
+
});
|
75
55
|
export var FunctionNode = createFunctionNode({
|
76
56
|
Node,
|
77
57
|
SymbolNode,
|
@@ -82,6 +62,26 @@ export var IndexNode = createIndexNode({
|
|
82
62
|
Range,
|
83
63
|
size
|
84
64
|
});
|
65
|
+
export var OperatorNode = createOperatorNode({
|
66
|
+
Node
|
67
|
+
});
|
68
|
+
export var ConstantNode = createConstantNode({
|
69
|
+
Node
|
70
|
+
});
|
71
|
+
export var FunctionAssignmentNode = createFunctionAssignmentNode({
|
72
|
+
Node,
|
73
|
+
typed
|
74
|
+
});
|
75
|
+
export var ParenthesisNode = createParenthesisNode({
|
76
|
+
Node
|
77
|
+
});
|
78
|
+
export var BlockNode = createBlockNode({
|
79
|
+
Node,
|
80
|
+
ResultSet
|
81
|
+
});
|
82
|
+
export var ArrayNode = createArrayNode({
|
83
|
+
Node
|
84
|
+
});
|
85
85
|
export var parse = createParse({
|
86
86
|
AccessorNode,
|
87
87
|
ArrayNode,
|
@@ -102,13 +102,6 @@ export var parse = createParse({
|
|
102
102
|
numeric,
|
103
103
|
typed
|
104
104
|
});
|
105
|
-
export var evaluate = createEvaluate({
|
106
|
-
parse,
|
107
|
-
typed
|
108
|
-
});
|
109
|
-
export var Help = createHelpClass({
|
110
|
-
parse
|
111
|
-
});
|
112
105
|
export var simplify = createSimplify({
|
113
106
|
ConstantNode,
|
114
107
|
FunctionNode,
|
@@ -127,33 +120,16 @@ export var simplify = createSimplify({
|
|
127
120
|
subtract,
|
128
121
|
typed
|
129
122
|
});
|
130
|
-
export var
|
131
|
-
ConstantNode,
|
132
|
-
FunctionNode,
|
133
|
-
OperatorNode,
|
134
|
-
ParenthesisNode,
|
135
|
-
SymbolNode,
|
136
|
-
add,
|
137
|
-
config,
|
138
|
-
divide,
|
139
|
-
equal,
|
140
|
-
isZero,
|
141
|
-
mathWithTransform,
|
142
|
-
multiply,
|
123
|
+
export var compile = createCompile({
|
143
124
|
parse,
|
144
|
-
pow,
|
145
|
-
simplify,
|
146
|
-
subtract,
|
147
125
|
typed
|
148
126
|
});
|
149
|
-
export var
|
127
|
+
export var evaluate = createEvaluate({
|
150
128
|
parse,
|
151
129
|
typed
|
152
130
|
});
|
153
|
-
export var
|
154
|
-
|
155
|
-
mathWithTransform,
|
156
|
-
typed
|
131
|
+
export var Help = createHelpClass({
|
132
|
+
parse
|
157
133
|
});
|
158
134
|
export var Parser = createParserClass({
|
159
135
|
evaluate
|
@@ -172,190 +148,230 @@ export var derivative = createDerivative({
|
|
172
148
|
simplify,
|
173
149
|
typed
|
174
150
|
});
|
151
|
+
export var rationalize = createRationalize({
|
152
|
+
ConstantNode,
|
153
|
+
FunctionNode,
|
154
|
+
OperatorNode,
|
155
|
+
ParenthesisNode,
|
156
|
+
SymbolNode,
|
157
|
+
add,
|
158
|
+
config,
|
159
|
+
divide,
|
160
|
+
equal,
|
161
|
+
isZero,
|
162
|
+
mathWithTransform,
|
163
|
+
multiply,
|
164
|
+
parse,
|
165
|
+
pow,
|
166
|
+
simplify,
|
167
|
+
subtract,
|
168
|
+
typed
|
169
|
+
});
|
170
|
+
export var help = createHelp({
|
171
|
+
Help,
|
172
|
+
mathWithTransform,
|
173
|
+
typed
|
174
|
+
});
|
175
175
|
export var parser = createParser({
|
176
176
|
Parser,
|
177
177
|
typed
|
178
178
|
});
|
179
179
|
|
180
180
|
_extends(math, {
|
181
|
-
typed,
|
182
|
-
chain,
|
183
|
-
nthRoot,
|
184
181
|
e,
|
185
182
|
false: _false,
|
183
|
+
index,
|
184
|
+
Infinity: _Infinity,
|
186
185
|
LN10,
|
187
186
|
LOG10E,
|
187
|
+
matrix,
|
188
188
|
NaN: _NaN,
|
189
|
+
null: _null,
|
189
190
|
phi,
|
191
|
+
replacer,
|
192
|
+
reviver,
|
190
193
|
SQRT1_2,
|
194
|
+
subset,
|
191
195
|
tau,
|
196
|
+
typed,
|
197
|
+
unaryPlus,
|
198
|
+
'E': e,
|
192
199
|
version,
|
193
|
-
string,
|
194
|
-
filter,
|
195
|
-
map,
|
196
|
-
combinationsWithRep,
|
197
|
-
pickRandom,
|
198
|
-
randomInt,
|
199
|
-
compare,
|
200
|
-
compareText,
|
201
|
-
smaller,
|
202
|
-
larger,
|
203
|
-
erf,
|
204
|
-
format,
|
205
|
-
clone,
|
206
|
-
typeOf,
|
207
|
-
reviver,
|
208
|
-
unaryMinus,
|
209
|
-
abs,
|
210
|
-
cbrt,
|
211
|
-
cube,
|
212
|
-
expm1,
|
213
|
-
floor,
|
214
|
-
lcm,
|
215
|
-
log2,
|
216
|
-
multiplyScalar,
|
217
|
-
sign,
|
218
|
-
square,
|
219
|
-
xgcd,
|
220
|
-
pow,
|
221
|
-
log1p,
|
222
|
-
norm,
|
223
|
-
bitAnd,
|
224
|
-
bitOr,
|
225
|
-
leftShift,
|
226
|
-
rightLogShift,
|
227
|
-
not,
|
228
200
|
xor,
|
229
|
-
|
230
|
-
combinations,
|
201
|
+
abs,
|
231
202
|
acos,
|
232
203
|
acot,
|
233
204
|
acsc,
|
205
|
+
add,
|
206
|
+
and,
|
234
207
|
asec,
|
235
208
|
asin,
|
236
209
|
atan,
|
237
210
|
atanh,
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
211
|
+
bitAnd,
|
212
|
+
bitOr,
|
213
|
+
boolean,
|
214
|
+
cbrt,
|
215
|
+
chain,
|
216
|
+
combinations,
|
217
|
+
compare,
|
218
|
+
compareText,
|
219
|
+
cos,
|
220
|
+
cot,
|
221
|
+
csc,
|
222
|
+
cube,
|
223
|
+
divide,
|
224
|
+
equalScalar,
|
225
|
+
erf,
|
226
|
+
exp,
|
227
|
+
filter,
|
228
|
+
fix,
|
229
|
+
forEach,
|
230
|
+
format,
|
231
|
+
gamma,
|
244
232
|
isInteger,
|
233
|
+
isNegative,
|
245
234
|
isPositive,
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
235
|
+
isZero,
|
236
|
+
LOG2E,
|
237
|
+
largerEq,
|
238
|
+
leftShift,
|
239
|
+
log10,
|
240
|
+
log2,
|
241
|
+
map,
|
242
|
+
mean,
|
243
|
+
mod,
|
244
|
+
multiply,
|
245
|
+
not,
|
252
246
|
number,
|
253
|
-
|
254
|
-
|
247
|
+
or,
|
248
|
+
pi,
|
249
|
+
pow,
|
255
250
|
random,
|
256
|
-
|
251
|
+
rightArithShift,
|
252
|
+
round,
|
253
|
+
sec,
|
254
|
+
sign,
|
255
|
+
sin,
|
256
|
+
size,
|
257
257
|
smallerEq,
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
258
|
+
square,
|
259
|
+
string,
|
260
|
+
subtract,
|
261
|
+
tanh,
|
262
|
+
typeOf,
|
263
|
+
unequal,
|
264
|
+
xgcd,
|
265
|
+
acoth,
|
262
266
|
addScalar,
|
263
|
-
|
264
|
-
gcd,
|
265
|
-
mod,
|
266
|
-
sqrt,
|
267
|
-
divideScalar,
|
268
|
-
add,
|
267
|
+
asech,
|
269
268
|
bitNot,
|
270
|
-
|
271
|
-
|
272
|
-
|
269
|
+
ceil,
|
270
|
+
combinationsWithRep,
|
271
|
+
cosh,
|
272
|
+
csch,
|
273
|
+
divideScalar,
|
274
|
+
equalText,
|
275
|
+
expm1,
|
276
|
+
isNumeric,
|
277
|
+
LN2,
|
278
|
+
lcm,
|
279
|
+
log1p,
|
280
|
+
multiplyScalar,
|
281
|
+
nthRoot,
|
282
|
+
pickRandom,
|
283
|
+
randomInt,
|
284
|
+
SQRT2,
|
285
|
+
sinh,
|
286
|
+
sqrt,
|
287
|
+
tan,
|
288
|
+
unaryMinus,
|
273
289
|
acosh,
|
274
|
-
|
290
|
+
apply,
|
275
291
|
asinh,
|
276
|
-
cos,
|
277
|
-
csc,
|
278
|
-
sin,
|
279
|
-
isZero,
|
280
|
-
hypot,
|
281
|
-
Infinity: _Infinity,
|
282
|
-
pi,
|
283
|
-
true: _true,
|
284
|
-
forEach,
|
285
|
-
partitionSelect,
|
286
|
-
equalScalar,
|
287
|
-
equalText,
|
288
|
-
unequal,
|
289
|
-
hasNumericValue,
|
290
|
-
unaryPlus,
|
291
|
-
fix,
|
292
|
-
multiply,
|
293
|
-
log,
|
294
292
|
bitXor,
|
295
|
-
index,
|
296
|
-
acoth,
|
297
|
-
atan2,
|
298
|
-
sec,
|
299
|
-
isNegative,
|
300
293
|
catalan,
|
301
|
-
|
302
|
-
boolean,
|
294
|
+
compareNatural,
|
303
295
|
equal,
|
304
|
-
deepEqual,
|
305
|
-
quantileSeq,
|
306
|
-
numeric,
|
307
|
-
log10,
|
308
|
-
divide,
|
309
|
-
gamma,
|
310
|
-
cot,
|
311
|
-
composition,
|
312
296
|
factorial,
|
313
|
-
|
297
|
+
hasNumericValue,
|
298
|
+
isNaN,
|
299
|
+
larger,
|
314
300
|
mode,
|
315
|
-
|
316
|
-
|
301
|
+
norm,
|
302
|
+
partitionSelect,
|
303
|
+
print,
|
304
|
+
quantileSeq,
|
305
|
+
rightLogShift,
|
306
|
+
smaller,
|
307
|
+
stirlingS2,
|
308
|
+
true: _true,
|
309
|
+
variance,
|
310
|
+
acsch,
|
311
|
+
atan2,
|
312
|
+
composition,
|
313
|
+
deepEqual,
|
314
|
+
floor,
|
315
|
+
hypot,
|
316
|
+
log,
|
317
317
|
median,
|
318
|
-
ceil,
|
319
|
-
and,
|
320
|
-
tan,
|
321
|
-
'PI': pi,
|
322
|
-
parse,
|
323
|
-
evaluate,
|
324
318
|
multinomial,
|
319
|
+
permutations,
|
320
|
+
range,
|
321
|
+
sech,
|
322
|
+
std,
|
323
|
+
'PI': pi,
|
324
|
+
clone,
|
325
|
+
coth,
|
326
|
+
gcd,
|
327
|
+
isPrime,
|
328
|
+
numeric,
|
325
329
|
prod,
|
326
|
-
|
327
|
-
|
330
|
+
bellNumbers,
|
331
|
+
mad,
|
332
|
+
sum,
|
333
|
+
max,
|
334
|
+
parse,
|
328
335
|
simplify,
|
329
|
-
rationalize,
|
330
336
|
compile,
|
331
|
-
|
332
|
-
mad,
|
333
|
-
help,
|
334
|
-
stirlingS2,
|
335
|
-
min,
|
336
|
-
asech,
|
337
|
+
evaluate,
|
337
338
|
derivative,
|
339
|
+
min,
|
340
|
+
rationalize,
|
341
|
+
help,
|
338
342
|
parser,
|
339
|
-
variance,
|
340
|
-
bellNumbers,
|
341
|
-
std,
|
342
|
-
range,
|
343
343
|
config
|
344
344
|
});
|
345
345
|
|
346
346
|
_extends(mathWithTransform, math, {
|
347
|
+
apply: createApplyTransform({
|
348
|
+
isInteger,
|
349
|
+
typed
|
350
|
+
}),
|
347
351
|
filter: createFilterTransform({
|
348
352
|
typed
|
349
353
|
}),
|
354
|
+
forEach: createForEachTransform({
|
355
|
+
typed
|
356
|
+
}),
|
350
357
|
map: createMapTransform({
|
351
358
|
typed
|
352
359
|
}),
|
353
|
-
|
360
|
+
mean: createMeanTransform({
|
361
|
+
add,
|
362
|
+
divide,
|
354
363
|
typed
|
355
364
|
}),
|
356
365
|
subset: createSubsetTransform({}),
|
357
|
-
|
358
|
-
|
366
|
+
std: createStdTransform({
|
367
|
+
sqrt,
|
368
|
+
typed,
|
369
|
+
variance
|
370
|
+
}),
|
371
|
+
sum: createSumTransform({
|
372
|
+
add,
|
373
|
+
config,
|
374
|
+
numeric,
|
359
375
|
typed
|
360
376
|
}),
|
361
377
|
max: createMaxTransform({
|
@@ -370,17 +386,6 @@ _extends(mathWithTransform, math, {
|
|
370
386
|
smaller,
|
371
387
|
typed
|
372
388
|
}),
|
373
|
-
sum: createSumTransform({
|
374
|
-
add,
|
375
|
-
config,
|
376
|
-
numeric,
|
377
|
-
typed
|
378
|
-
}),
|
379
|
-
mean: createMeanTransform({
|
380
|
-
add,
|
381
|
-
divide,
|
382
|
-
typed
|
383
|
-
}),
|
384
389
|
range: createRangeTransform({
|
385
390
|
matrix,
|
386
391
|
config,
|
@@ -398,34 +403,29 @@ _extends(mathWithTransform, math, {
|
|
398
403
|
multiply,
|
399
404
|
subtract,
|
400
405
|
typed
|
401
|
-
}),
|
402
|
-
std: createStdTransform({
|
403
|
-
sqrt,
|
404
|
-
typed,
|
405
|
-
variance
|
406
406
|
})
|
407
407
|
});
|
408
408
|
|
409
409
|
_extends(classes, {
|
410
|
-
Range,
|
411
410
|
Chain,
|
411
|
+
Range,
|
412
412
|
Node,
|
413
|
-
ArrayNode,
|
414
|
-
ConditionalNode,
|
415
|
-
FunctionAssignmentNode,
|
416
413
|
ObjectNode,
|
417
|
-
|
414
|
+
RangeNode,
|
418
415
|
RelationalNode,
|
419
|
-
ResultSet,
|
420
|
-
BlockNode,
|
421
|
-
OperatorNode,
|
422
416
|
SymbolNode,
|
423
417
|
AccessorNode,
|
424
|
-
ConstantNode,
|
425
|
-
RangeNode,
|
426
418
|
AssignmentNode,
|
419
|
+
ConditionalNode,
|
427
420
|
FunctionNode,
|
428
421
|
IndexNode,
|
422
|
+
OperatorNode,
|
423
|
+
ResultSet,
|
424
|
+
ConstantNode,
|
425
|
+
FunctionAssignmentNode,
|
426
|
+
ParenthesisNode,
|
427
|
+
BlockNode,
|
428
|
+
ArrayNode,
|
429
429
|
Help,
|
430
430
|
Parser
|
431
431
|
});
|