mathjs 13.2.2 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/HISTORY.md +26 -0
  2. package/lib/browser/math.js +1 -1
  3. package/lib/browser/math.js.LICENSE.txt +2 -10
  4. package/lib/browser/math.js.map +1 -1
  5. package/lib/cjs/core/function/import.js +4 -1
  6. package/lib/cjs/core/function/typed.js +1 -1
  7. package/lib/cjs/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
  8. package/lib/cjs/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
  9. package/lib/cjs/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
  10. package/lib/cjs/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
  11. package/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  12. package/lib/cjs/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
  13. package/lib/cjs/entry/dependenciesAny/dependenciesLog.generated.js +2 -0
  14. package/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js +2 -0
  15. package/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  16. package/lib/cjs/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
  17. package/lib/cjs/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
  18. package/lib/cjs/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
  19. package/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js +2 -0
  20. package/lib/cjs/entry/impureFunctionsAny.generated.js +1 -0
  21. package/lib/cjs/entry/impureFunctionsNumber.generated.js +1 -0
  22. package/lib/cjs/entry/pureFunctionsAny.generated.js +11 -0
  23. package/lib/cjs/expression/embeddedDocs/function/arithmetic/ceil.js +2 -2
  24. package/lib/cjs/expression/embeddedDocs/function/arithmetic/fix.js +2 -2
  25. package/lib/cjs/expression/embeddedDocs/function/arithmetic/floor.js +2 -2
  26. package/lib/cjs/expression/parse.js +26 -36
  27. package/lib/cjs/function/algebra/simplify.js +4 -3
  28. package/lib/cjs/function/algebra/simplifyConstant.js +5 -11
  29. package/lib/cjs/function/arithmetic/ceil.js +21 -2
  30. package/lib/cjs/function/arithmetic/dotDivide.js +4 -3
  31. package/lib/cjs/function/arithmetic/dotPow.js +4 -3
  32. package/lib/cjs/function/arithmetic/fix.js +24 -5
  33. package/lib/cjs/function/arithmetic/floor.js +21 -2
  34. package/lib/cjs/function/arithmetic/log.js +12 -4
  35. package/lib/cjs/function/arithmetic/pow.js +2 -2
  36. package/lib/cjs/function/arithmetic/round.js +3 -5
  37. package/lib/cjs/function/arithmetic/sign.js +1 -1
  38. package/lib/cjs/function/bitwise/bitXor.js +4 -3
  39. package/lib/cjs/function/logical/xor.js +4 -3
  40. package/lib/cjs/function/matrix/filter.js +7 -0
  41. package/lib/cjs/function/matrix/forEach.js +7 -0
  42. package/lib/cjs/function/relational/equal.js +4 -3
  43. package/lib/cjs/function/relational/larger.js +4 -3
  44. package/lib/cjs/function/relational/largerEq.js +4 -3
  45. package/lib/cjs/function/relational/smaller.js +4 -3
  46. package/lib/cjs/function/relational/smallerEq.js +4 -3
  47. package/lib/cjs/function/relational/unequal.js +4 -3
  48. package/lib/cjs/function/utils/isInteger.js +1 -1
  49. package/lib/cjs/function/utils/isNegative.js +1 -1
  50. package/lib/cjs/function/utils/isPositive.js +1 -1
  51. package/lib/cjs/header.js +2 -2
  52. package/lib/cjs/type/bignumber/function/bignumber.js +2 -2
  53. package/lib/cjs/type/fraction/Fraction.js +4 -4
  54. package/lib/cjs/type/fraction/function/fraction.js +3 -0
  55. package/lib/cjs/type/matrix/utils/matAlgo07xSSf.js +39 -43
  56. package/lib/cjs/type/unit/Unit.js +1 -1
  57. package/lib/cjs/utils/object.js +4 -0
  58. package/lib/cjs/utils/string.js +2 -2
  59. package/lib/cjs/version.js +1 -1
  60. package/lib/esm/core/function/import.js +4 -1
  61. package/lib/esm/core/function/typed.js +1 -1
  62. package/lib/esm/entry/dependenciesAny/dependenciesBitXor.generated.js +2 -0
  63. package/lib/esm/entry/dependenciesAny/dependenciesDotDivide.generated.js +2 -0
  64. package/lib/esm/entry/dependenciesAny/dependenciesDotPow.generated.js +2 -0
  65. package/lib/esm/entry/dependenciesAny/dependenciesEqual.generated.js +2 -0
  66. package/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  67. package/lib/esm/entry/dependenciesAny/dependenciesLargerEq.generated.js +2 -0
  68. package/lib/esm/entry/dependenciesAny/dependenciesLog.generated.js +2 -0
  69. package/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js +2 -0
  70. package/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  71. package/lib/esm/entry/dependenciesAny/dependenciesSmallerEq.generated.js +2 -0
  72. package/lib/esm/entry/dependenciesAny/dependenciesUnequal.generated.js +2 -0
  73. package/lib/esm/entry/dependenciesAny/dependenciesXor.generated.js +2 -0
  74. package/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js +2 -0
  75. package/lib/esm/entry/impureFunctionsAny.generated.js +1 -0
  76. package/lib/esm/entry/impureFunctionsNumber.generated.js +1 -0
  77. package/lib/esm/entry/pureFunctionsAny.generated.js +11 -0
  78. package/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js +2 -2
  79. package/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js +2 -2
  80. package/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js +2 -2
  81. package/lib/esm/expression/parse.js +26 -36
  82. package/lib/esm/function/algebra/simplify.js +4 -3
  83. package/lib/esm/function/algebra/simplifyConstant.js +5 -11
  84. package/lib/esm/function/arithmetic/ceil.js +21 -2
  85. package/lib/esm/function/arithmetic/dotDivide.js +4 -3
  86. package/lib/esm/function/arithmetic/dotPow.js +4 -3
  87. package/lib/esm/function/arithmetic/fix.js +24 -5
  88. package/lib/esm/function/arithmetic/floor.js +21 -2
  89. package/lib/esm/function/arithmetic/log.js +12 -4
  90. package/lib/esm/function/arithmetic/pow.js +2 -2
  91. package/lib/esm/function/arithmetic/round.js +3 -5
  92. package/lib/esm/function/arithmetic/sign.js +1 -1
  93. package/lib/esm/function/bitwise/bitXor.js +4 -3
  94. package/lib/esm/function/logical/xor.js +4 -3
  95. package/lib/esm/function/matrix/filter.js +7 -0
  96. package/lib/esm/function/matrix/forEach.js +7 -0
  97. package/lib/esm/function/relational/equal.js +4 -3
  98. package/lib/esm/function/relational/larger.js +4 -3
  99. package/lib/esm/function/relational/largerEq.js +4 -3
  100. package/lib/esm/function/relational/smaller.js +4 -3
  101. package/lib/esm/function/relational/smallerEq.js +4 -3
  102. package/lib/esm/function/relational/unequal.js +4 -3
  103. package/lib/esm/function/utils/isInteger.js +1 -1
  104. package/lib/esm/function/utils/isNegative.js +1 -1
  105. package/lib/esm/function/utils/isPositive.js +1 -1
  106. package/lib/esm/type/bignumber/function/bignumber.js +2 -2
  107. package/lib/esm/type/fraction/Fraction.js +4 -4
  108. package/lib/esm/type/fraction/function/fraction.js +3 -0
  109. package/lib/esm/type/matrix/utils/matAlgo07xSSf.js +39 -43
  110. package/lib/esm/type/unit/Unit.js +1 -1
  111. package/lib/esm/utils/object.js +4 -0
  112. package/lib/esm/utils/string.js +2 -2
  113. package/lib/esm/version.js +1 -1
  114. package/package.json +3 -3
  115. package/types/index.d.ts +115 -25
@@ -7,21 +7,22 @@ import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';
7
7
  import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';
8
8
  import { createCompareUnits } from './compareUnits.js';
9
9
  var name = 'smaller';
10
- var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];
10
+ var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix'];
11
11
  export var createSmaller = /* #__PURE__ */factory(name, dependencies, _ref => {
12
12
  var {
13
13
  typed,
14
14
  config,
15
15
  matrix,
16
16
  DenseMatrix,
17
- concat
17
+ concat,
18
+ SparseMatrix
18
19
  } = _ref;
19
20
  var matAlgo03xDSf = createMatAlgo03xDSf({
20
21
  typed
21
22
  });
22
23
  var matAlgo07xSSf = createMatAlgo07xSSf({
23
24
  typed,
24
- DenseMatrix
25
+ SparseMatrix
25
26
  });
26
27
  var matAlgo12xSfs = createMatAlgo12xSfs({
27
28
  typed,
@@ -7,21 +7,22 @@ import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';
7
7
  import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';
8
8
  import { createCompareUnits } from './compareUnits.js';
9
9
  var name = 'smallerEq';
10
- var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat'];
10
+ var dependencies = ['typed', 'config', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix'];
11
11
  export var createSmallerEq = /* #__PURE__ */factory(name, dependencies, _ref => {
12
12
  var {
13
13
  typed,
14
14
  config,
15
15
  matrix,
16
16
  DenseMatrix,
17
- concat
17
+ concat,
18
+ SparseMatrix
18
19
  } = _ref;
19
20
  var matAlgo03xDSf = createMatAlgo03xDSf({
20
21
  typed
21
22
  });
22
23
  var matAlgo07xSSf = createMatAlgo07xSSf({
23
24
  typed,
24
- DenseMatrix
25
+ SparseMatrix
25
26
  });
26
27
  var matAlgo12xSfs = createMatAlgo12xSfs({
27
28
  typed,
@@ -4,7 +4,7 @@ import { createMatAlgo07xSSf } from '../../type/matrix/utils/matAlgo07xSSf.js';
4
4
  import { createMatAlgo12xSfs } from '../../type/matrix/utils/matAlgo12xSfs.js';
5
5
  import { createMatrixAlgorithmSuite } from '../../type/matrix/utils/matrixAlgorithmSuite.js';
6
6
  var name = 'unequal';
7
- var dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat'];
7
+ var dependencies = ['typed', 'config', 'equalScalar', 'matrix', 'DenseMatrix', 'concat', 'SparseMatrix'];
8
8
  export var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {
9
9
  var {
10
10
  typed,
@@ -12,14 +12,15 @@ export var createUnequal = /* #__PURE__ */factory(name, dependencies, _ref => {
12
12
  equalScalar,
13
13
  matrix,
14
14
  DenseMatrix,
15
- concat
15
+ concat,
16
+ SparseMatrix
16
17
  } = _ref;
17
18
  var matAlgo03xDSf = createMatAlgo03xDSf({
18
19
  typed
19
20
  });
20
21
  var matAlgo07xSSf = createMatAlgo07xSSf({
21
22
  typed,
22
- DenseMatrix
23
+ SparseMatrix
23
24
  });
24
25
  var matAlgo12xSfs = createMatAlgo12xSfs({
25
26
  typed,
@@ -47,7 +47,7 @@ export var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref =>
47
47
  return true;
48
48
  },
49
49
  Fraction: function Fraction(x) {
50
- return x.d === 1 && isFinite(x.n);
50
+ return x.d === 1n;
51
51
  },
52
52
  'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))
53
53
  });
@@ -43,7 +43,7 @@ export var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref =>
43
43
  number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isNegativeNumber(x),
44
44
  BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : x.isNeg() && !x.isZero() && !x.isNaN(),
45
45
  bigint: x => x < 0n,
46
- Fraction: x => x.s < 0,
46
+ Fraction: x => x.s < 0n,
47
47
  // It's enough to decide on the sign
48
48
 
49
49
  Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),
@@ -45,7 +45,7 @@ export var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref =>
45
45
  number: x => nearlyEqual(x, 0, config.relTol, config.absTol) ? false : isPositiveNumber(x),
46
46
  BigNumber: x => bigNearlyEqual(x, new x.constructor(0), config.relTol, config.absTol) ? false : !x.isNeg() && !x.isZero() && !x.isNaN(),
47
47
  bigint: x => x > 0n,
48
- Fraction: x => x.s > 0 && x.n > 0,
48
+ Fraction: x => x.s > 0n && x.n > 0n,
49
49
  Unit: typed.referToSelf(self => x => typed.find(self, x.valueType())(x.value)),
50
50
  'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))
51
51
  });
@@ -72,9 +72,9 @@ export var createBignumber = /* #__PURE__ */factory(name, dependencies, _ref =>
72
72
  return clone;
73
73
  }),
74
74
  Fraction: function Fraction(x) {
75
- return new BigNumber(x.n).div(x.d).times(x.s);
75
+ return new BigNumber(String(x.n)).div(String(x.d)).times(String(x.s));
76
76
  },
77
- null: function _null(x) {
77
+ null: function _null(_x) {
78
78
  return new BigNumber(0);
79
79
  },
80
80
  'Array | Matrix': typed.referToSelf(self => x => deepMap(x, self))
@@ -16,20 +16,20 @@ export var createFractionClass = /* #__PURE__ */factory(name, dependencies, () =
16
16
  /**
17
17
  * Get a JSON representation of a Fraction containing type information
18
18
  * @returns {Object} Returns a JSON object structured as:
19
- * `{"mathjs": "Fraction", "n": 3, "d": 8}`
19
+ * `{"mathjs": "Fraction", "n": "3", "d": "8"}`
20
20
  */
21
21
  Fraction.prototype.toJSON = function () {
22
22
  return {
23
23
  mathjs: 'Fraction',
24
- n: this.s * this.n,
25
- d: this.d
24
+ n: String(this.s * this.n),
25
+ d: String(this.d)
26
26
  };
27
27
  };
28
28
 
29
29
  /**
30
30
  * Instantiate a Fraction from a JSON object
31
31
  * @param {Object} json a JSON object structured as:
32
- * `{"mathjs": "Fraction", "n": 3, "d": 8}`
32
+ * `{"mathjs": "Fraction", "n": "3", "d": "8"}`
33
33
  * @return {BigNumber}
34
34
  */
35
35
  Fraction.fromJSON = function (json) {
@@ -57,6 +57,9 @@ export var createFraction = /* #__PURE__ */factory(name, dependencies, _ref => {
57
57
  'number, number': function number_number(numerator, denominator) {
58
58
  return new Fraction(numerator, denominator);
59
59
  },
60
+ 'bigint, bigint': function bigint_bigint(numerator, denominator) {
61
+ return new Fraction(numerator, denominator);
62
+ },
60
63
  null: function _null(x) {
61
64
  return new Fraction(0);
62
65
  },
@@ -1,31 +1,30 @@
1
1
  import { factory } from '../../../utils/factory.js';
2
2
  import { DimensionError } from '../../../error/DimensionError.js';
3
3
  var name = 'matAlgo07xSSf';
4
- var dependencies = ['typed', 'DenseMatrix'];
4
+ var dependencies = ['typed', 'SparseMatrix'];
5
5
  export var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref => {
6
6
  var {
7
7
  typed,
8
- DenseMatrix
8
+ SparseMatrix
9
9
  } = _ref;
10
10
  /**
11
- * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).
12
- * Callback function invoked MxN times.
13
- *
14
- * C(i,j) = f(Aij, Bij)
15
- *
16
- * @param {Matrix} a The SparseMatrix instance (A)
17
- * @param {Matrix} b The SparseMatrix instance (B)
18
- * @param {Function} callback The f(Aij,Bij) operation to invoke
19
- *
20
- * @return {Matrix} DenseMatrix (C)
21
- *
22
- * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294
23
- */
11
+ * Iterates over SparseMatrix A and SparseMatrix B items (zero and nonzero) and invokes the callback function f(Aij, Bij).
12
+ * Callback function invoked MxN times.
13
+ *
14
+ * C(i,j) = f(Aij, Bij)
15
+ *
16
+ * @param {Matrix} a The SparseMatrix instance (A)
17
+ * @param {Matrix} b The SparseMatrix instance (B)
18
+ * @param {Function} callback The f(Aij,Bij) operation to invoke
19
+ *
20
+ * @return {Matrix} SparseMatrix (C)
21
+ *
22
+ * see https://github.com/josdejong/mathjs/pull/346#issuecomment-97620294
23
+ */
24
24
  return function matAlgo07xSSf(a, b, callback) {
25
25
  // sparse matrix arrays
26
26
  var asize = a._size;
27
27
  var adt = a._datatype || a._data === undefined ? a._datatype : a.getDataType();
28
- // sparse matrix arrays
29
28
  var bsize = b._size;
30
29
  var bdt = b._datatype || b._data === undefined ? b._datatype : b.getDataType();
31
30
 
@@ -33,8 +32,6 @@ export var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref
33
32
  if (asize.length !== bsize.length) {
34
33
  throw new DimensionError(asize.length, bsize.length);
35
34
  }
36
-
37
- // check rows & columns
38
35
  if (asize[0] !== bsize[0] || asize[1] !== bsize[1]) {
39
36
  throw new RangeError('Dimension mismatch. Matrix A (' + asize + ') must match Matrix B (' + bsize + ')');
40
37
  }
@@ -45,59 +42,58 @@ export var createMatAlgo07xSSf = /* #__PURE__ */factory(name, dependencies, _ref
45
42
 
46
43
  // datatype
47
44
  var dt;
48
- // zero value
49
45
  var zero = 0;
50
- // callback signature to use
51
46
  var cf = callback;
52
47
 
53
48
  // process data types
54
49
  if (typeof adt === 'string' && adt === bdt && adt !== 'mixed') {
55
- // datatype
56
50
  dt = adt;
57
- // convert 0 to the same datatype
58
51
  zero = typed.convert(0, dt);
59
- // callback
60
52
  cf = typed.find(callback, [dt, dt]);
61
53
  }
62
54
 
63
- // vars
64
- var i, j;
65
-
66
- // result arrays
67
- var cdata = [];
68
- // initialize c
69
- for (i = 0; i < rows; i++) {
70
- cdata[i] = [];
71
- }
55
+ // result arrays for sparse format
56
+ var cvalues = [];
57
+ var cindex = [];
58
+ var cptr = new Array(columns + 1).fill(0); // Start with column pointer array
72
59
 
73
60
  // workspaces
74
61
  var xa = [];
75
62
  var xb = [];
76
- // marks indicating we have a value in x for a given column
77
63
  var wa = [];
78
64
  var wb = [];
79
65
 
80
66
  // loop columns
81
- for (j = 0; j < columns; j++) {
82
- // columns mark
67
+ for (var j = 0; j < columns; j++) {
83
68
  var mark = j + 1;
84
- // scatter the values of A(:,j) into workspace
69
+ var nonZeroCount = 0;
85
70
  _scatter(a, j, wa, xa, mark);
86
- // scatter the values of B(:,j) into workspace
87
71
  _scatter(b, j, wb, xb, mark);
72
+
88
73
  // loop rows
89
- for (i = 0; i < rows; i++) {
90
- // matrix values @ i,j
74
+ for (var i = 0; i < rows; i++) {
91
75
  var va = wa[i] === mark ? xa[i] : zero;
92
76
  var vb = wb[i] === mark ? xb[i] : zero;
77
+
93
78
  // invoke callback
94
- cdata[i][j] = cf(va, vb);
79
+ var cij = cf(va, vb);
80
+ // Store all non zero and true values
81
+ if (cij !== 0 && cij !== false) {
82
+ cindex.push(i); // row index
83
+ cvalues.push(cij); // computed value
84
+ nonZeroCount++;
85
+ }
95
86
  }
87
+
88
+ // Update column pointer with cumulative count of non-zero values
89
+ cptr[j + 1] = cptr[j] + nonZeroCount;
96
90
  }
97
91
 
98
- // return dense matrix
99
- return new DenseMatrix({
100
- data: cdata,
92
+ // Return the result as a sparse matrix
93
+ return new SparseMatrix({
94
+ values: cvalues,
95
+ index: cindex,
96
+ ptr: cptr,
101
97
  size: [rows, columns],
102
98
  datatype: adt === a._datatype && bdt === b._datatype ? dt : undefined
103
99
  });
@@ -3533,7 +3533,7 @@ export var createUnitClass = /* #__PURE__ */factory(name, dependencies, _ref =>
3533
3533
  */
3534
3534
  Unit.typeConverters = {
3535
3535
  BigNumber: function BigNumber(x) {
3536
- if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(x.n).div(x.d).times(x.s);
3536
+ if (x !== null && x !== void 0 && x.isFraction) return new _BigNumber(String(x.n)).div(String(x.d)).times(String(x.s));
3537
3537
  return new _BigNumber(x + ''); // stringify to prevent constructor error
3538
3538
  },
3539
3539
  Fraction: function Fraction(x) {
@@ -37,6 +37,10 @@ export function clone(x) {
37
37
  if (isObject(x)) {
38
38
  return mapObject(x, clone);
39
39
  }
40
+ if (type === 'function') {
41
+ // we assume that the function is immutable
42
+ return x;
43
+ }
40
44
  throw new TypeError("Cannot clone: unknown type of value (value: ".concat(x, ")"));
41
45
  }
42
46
 
@@ -71,7 +71,7 @@ function _format(value, options) {
71
71
  if (looksLikeFraction(value)) {
72
72
  if (!options || options.fraction !== 'decimal') {
73
73
  // output as ratio, like '1/3'
74
- return value.s * value.n + '/' + value.d;
74
+ return "".concat(value.s * value.n, "/").concat(value.d);
75
75
  } else {
76
76
  // output as decimal, like '0.(3)'
77
77
  return value.toString();
@@ -173,7 +173,7 @@ function formatArray(array, options) {
173
173
  * @return {boolean}
174
174
  */
175
175
  function looksLikeFraction(value) {
176
- return value && typeof value === 'object' && typeof value.s === 'number' && typeof value.n === 'number' && typeof value.d === 'number' || false;
176
+ return value && typeof value === 'object' && typeof value.s === 'bigint' && typeof value.n === 'bigint' && typeof value.d === 'bigint' || false;
177
177
  }
178
178
 
179
179
  /**
@@ -1,3 +1,3 @@
1
- export var version = '13.2.2';
1
+ export var version = '14.0.0';
2
2
  // Note: This file is automatically generated when building math.js.
3
3
  // Changes made in this file will be overwritten.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mathjs",
3
- "version": "13.2.2",
3
+ "version": "14.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",
@@ -29,7 +29,7 @@
29
29
  "complex.js": "^2.2.5",
30
30
  "decimal.js": "^10.4.3",
31
31
  "escape-latex": "^1.2.0",
32
- "fraction.js": "^4.3.7",
32
+ "fraction.js": "^5.2.1",
33
33
  "javascript-natural-sort": "^0.7.1",
34
34
  "seedrandom": "^3.0.5",
35
35
  "tiny-emitter": "^2.1.0",
@@ -69,7 +69,7 @@
69
69
  "gulp": "5.0.0",
70
70
  "gulp-babel": "8.0.0",
71
71
  "handlebars": "4.7.8",
72
- "jsep": "1.3.9",
72
+ "jsep": "1.4.0",
73
73
  "karma": "6.4.4",
74
74
  "karma-browserstack-launcher": "1.6.0",
75
75
  "karma-firefox-launcher": "2.1.3",