mathjs 11.0.0 → 11.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. package/HISTORY.md +6 -0
  2. package/lib/browser/math.js +1 -1
  3. package/lib/browser/math.js.LICENSE.txt +2 -2
  4. package/lib/browser/math.js.map +1 -1
  5. package/lib/cjs/function/algebra/derivative.js +3 -3
  6. package/lib/cjs/function/algebra/simplify.js +3 -1
  7. package/lib/cjs/function/algebra/symbolicEqual.js +5 -6
  8. package/lib/cjs/function/arithmetic/fix.js +1 -1
  9. package/lib/cjs/function/arithmetic/floor.js +1 -1
  10. package/lib/cjs/function/arithmetic/invmod.js +1 -1
  11. package/lib/cjs/function/arithmetic/nthRoot.js +3 -3
  12. package/lib/cjs/function/arithmetic/nthRoots.js +2 -2
  13. package/lib/cjs/function/bitwise/bitNot.js +1 -1
  14. package/lib/cjs/function/bitwise/leftShift.js +1 -1
  15. package/lib/cjs/function/bitwise/rightArithShift.js +1 -1
  16. package/lib/cjs/function/bitwise/rightLogShift.js +1 -1
  17. package/lib/cjs/function/geometry/distance.js +2 -2
  18. package/lib/cjs/function/matrix/diff.js +1 -1
  19. package/lib/cjs/function/matrix/rotate.js +5 -5
  20. package/lib/cjs/function/string/format.js +2 -2
  21. package/lib/cjs/function/string/hex.js +1 -2
  22. package/lib/cjs/function/trigonometry/acot.js +2 -3
  23. package/lib/cjs/function/trigonometry/acsc.js +2 -3
  24. package/lib/cjs/function/trigonometry/asec.js +2 -2
  25. package/lib/cjs/function/trigonometry/asin.js +1 -1
  26. package/lib/cjs/function/trigonometry/atan.js +1 -2
  27. package/lib/cjs/function/trigonometry/atan2.js +1 -1
  28. package/lib/cjs/function/utils/clone.js +1 -1
  29. package/lib/cjs/function/utils/hasNumericValue.js +1 -1
  30. package/lib/cjs/function/utils/isInteger.js +1 -1
  31. package/lib/cjs/function/utils/isNaN.js +1 -1
  32. package/lib/cjs/function/utils/isNegative.js +1 -1
  33. package/lib/cjs/function/utils/isNumeric.js +1 -1
  34. package/lib/cjs/function/utils/isPositive.js +1 -1
  35. package/lib/cjs/function/utils/isZero.js +11 -11
  36. package/lib/cjs/header.js +2 -2
  37. package/lib/cjs/version.js +1 -1
  38. package/lib/esm/function/algebra/derivative.js +3 -3
  39. package/lib/esm/function/algebra/simplify.js +3 -1
  40. package/lib/esm/function/algebra/symbolicEqual.js +5 -6
  41. package/lib/esm/function/arithmetic/fix.js +1 -1
  42. package/lib/esm/function/arithmetic/floor.js +1 -1
  43. package/lib/esm/function/arithmetic/invmod.js +1 -1
  44. package/lib/esm/function/arithmetic/nthRoot.js +3 -3
  45. package/lib/esm/function/arithmetic/nthRoots.js +2 -2
  46. package/lib/esm/function/bitwise/bitNot.js +1 -1
  47. package/lib/esm/function/bitwise/leftShift.js +1 -1
  48. package/lib/esm/function/bitwise/rightArithShift.js +1 -1
  49. package/lib/esm/function/bitwise/rightLogShift.js +1 -1
  50. package/lib/esm/function/geometry/distance.js +2 -2
  51. package/lib/esm/function/matrix/diff.js +1 -1
  52. package/lib/esm/function/matrix/rotate.js +5 -5
  53. package/lib/esm/function/string/format.js +2 -2
  54. package/lib/esm/function/string/hex.js +1 -2
  55. package/lib/esm/function/trigonometry/acot.js +2 -3
  56. package/lib/esm/function/trigonometry/acsc.js +2 -3
  57. package/lib/esm/function/trigonometry/asec.js +2 -2
  58. package/lib/esm/function/trigonometry/asin.js +1 -1
  59. package/lib/esm/function/trigonometry/atan.js +1 -2
  60. package/lib/esm/function/trigonometry/atan2.js +1 -1
  61. package/lib/esm/function/utils/clone.js +1 -1
  62. package/lib/esm/function/utils/hasNumericValue.js +1 -1
  63. package/lib/esm/function/utils/isInteger.js +1 -1
  64. package/lib/esm/function/utils/isNaN.js +1 -1
  65. package/lib/esm/function/utils/isNegative.js +1 -1
  66. package/lib/esm/function/utils/isNumeric.js +1 -1
  67. package/lib/esm/function/utils/isPositive.js +1 -1
  68. package/lib/esm/function/utils/isZero.js +11 -11
  69. package/lib/esm/version.js +1 -1
  70. package/package.json +1 -1
  71. package/types/index.d.ts +7 -3
  72. package/types/index.ts +102 -95
@@ -20,13 +20,13 @@ export var createRotate = /* #__PURE__ */factory(name, dependencies, _ref => {
20
20
  *
21
21
  * Examples:
22
22
  *
23
- * math.rotate([11, 12], math.pi / 2) // returns matrix([-12, 11])
24
- * math.rotate(matrix([11, 12]), math.pi / 2) // returns matrix([-12, 11])
23
+ * math.rotate([11, 12], math.pi / 2) // returns [-12, 11]
24
+ * math.rotate(matrix([11, 12]), math.pi / 2) // returns [-12, 11]
25
25
  *
26
- * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns matrix([0, 1, 0])
27
- * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns matrix([0, 1, 0])
26
+ * math.rotate([1, 0, 0], unit('90deg'), [0, 0, 1]) // returns [0, 1, 0]
27
+ * math.rotate(matrix([1, 0, 0]), unit('90deg'), [0, 0, 1]) // returns Matrix [0, 1, 0]
28
28
  *
29
- * math.rotate([1, 0], math.complex(1 + i)) // returns matrix([cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)])
29
+ * math.rotate([1, 0], math.complex(1 + i)) // returns [cos(1 + i) - sin(1 + i), sin(1 + i) + cos(1 + i)]
30
30
  *
31
31
  * See also:
32
32
  *
@@ -98,14 +98,14 @@ export var createFormat = /* #__PURE__ */factory(name, dependencies, _ref => {
98
98
  * Examples:
99
99
  *
100
100
  * math.format(6.4) // returns '6.4'
101
- * math.format(1240000) // returns '1.24e6'
101
+ * math.format(1240000) // returns '1.24e+6'
102
102
  * math.format(1/3) // returns '0.3333333333333333'
103
103
  * math.format(1/3, 3) // returns '0.333'
104
104
  * math.format(21385, 2) // returns '21000'
105
105
  * math.format(12e8, {notation: 'fixed'}) // returns '1200000000'
106
106
  * math.format(2.3, {notation: 'fixed', precision: 4}) // returns '2.3000'
107
107
  * math.format(52.8, {notation: 'exponential'}) // returns '5.28e+1'
108
- * math.format(12400,{notation: 'engineering'}) // returns '12.400e+3'
108
+ * math.format(12400, {notation: 'engineering'}) // returns '12.4e+3'
109
109
  * math.format(2000, {lowerExp: -2, upperExp: 2}) // returns '2e+3'
110
110
  *
111
111
  * function formatCurrency(value) {
@@ -10,8 +10,7 @@ var dependencies = ['typed', 'format'];
10
10
  *
11
11
  * Examples:
12
12
  *
13
- * //the following outputs "0xF0"
14
- * math.hex(240)
13
+ * math.hex(240) // returns "0xF0"
15
14
  *
16
15
  * See also:
17
16
  *
@@ -20,11 +20,10 @@ export var createAcot = /* #__PURE__ */factory(name, dependencies, _ref => {
20
20
  *
21
21
  * Examples:
22
22
  *
23
- * math.acot(0.5) // returns number 0.4636476090008061
23
+ * math.acot(0.5) // returns number 1.1071487177940904
24
+ * math.acot(2) // returns number 0.4636476090008061
24
25
  * math.acot(math.cot(1.5)) // returns number 1.5
25
26
  *
26
- * math.acot(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
27
- *
28
27
  * See also:
29
28
  *
30
29
  * cot, atan
@@ -22,11 +22,10 @@ export var createAcsc = /* #__PURE__ */factory(name, dependencies, _ref => {
22
22
  *
23
23
  * Examples:
24
24
  *
25
- * math.acsc(0.5) // returns number 0.5235987755982989
25
+ * math.acsc(2) // returns 0.5235987755982989
26
+ * math.acsc(0.5) // returns Complex 1.5707963267948966 -1.3169578969248166i
26
27
  * math.acsc(math.csc(1.5)) // returns number ~1.5
27
28
  *
28
- * math.acsc(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
29
- *
30
29
  * See also:
31
30
  *
32
31
  * csc, asin, asec
@@ -22,10 +22,10 @@ export var createAsec = /* #__PURE__ */factory(name, dependencies, _ref => {
22
22
  *
23
23
  * Examples:
24
24
  *
25
- * math.asec(0.5) // returns 1.0471975511965979
25
+ * math.asec(2) // returns 1.0471975511965979
26
26
  * math.asec(math.sec(1.5)) // returns 1.5
27
27
  *
28
- * math.asec(2) // returns 0 + 1.3169578969248166 i
28
+ * math.asec(0.5) // returns Complex 0 + 1.3169578969248166i
29
29
  *
30
30
  * See also:
31
31
  *
@@ -23,7 +23,7 @@ export var createAsin = /* #__PURE__ */factory(name, dependencies, _ref => {
23
23
  * math.asin(0.5) // returns number 0.5235987755982989
24
24
  * math.asin(math.sin(1.5)) // returns number ~1.5
25
25
  *
26
- * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
26
+ * math.asin(2) // returns Complex 1.5707963267948966 -1.3169578969248166i
27
27
  *
28
28
  * See also:
29
29
  *
@@ -19,10 +19,9 @@ export var createAtan = /* #__PURE__ */factory(name, dependencies, _ref => {
19
19
  * Examples:
20
20
  *
21
21
  * math.atan(0.5) // returns number 0.4636476090008061
22
+ * math.atan(2) // returns number 1.1071487177940904
22
23
  * math.atan(math.tan(1.5)) // returns number 1.5
23
24
  *
24
- * math.atan(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
25
- *
26
25
  * See also:
27
26
  *
28
27
  * tan, asin, acos
@@ -57,7 +57,7 @@ export var createAtan2 = /* #__PURE__ */factory(name, dependencies, _ref => {
57
57
  * const x = math.cos(angle)
58
58
  * const y = math.sin(angle)
59
59
  *
60
- * math.atan(2) // returns Complex 1.5707963267948966 -1.3169578969248166 i
60
+ * math.atan(2) // returns number 1.1071487177940904
61
61
  *
62
62
  * See also:
63
63
  *
@@ -17,7 +17,7 @@ export var createClone = /* #__PURE__ */factory(name, dependencies, _ref => {
17
17
  * Examples:
18
18
  *
19
19
  * math.clone(3.5) // returns number 3.5
20
- * math.clone(math.complex('2-4i') // returns Complex 2 - 4i
20
+ * math.clone(math.complex('2-4i')) // returns Complex 2 - 4i
21
21
  * math.clone(math.unit(45, 'deg')) // returns Unit 45 deg
22
22
  * math.clone([[1, 2], [3, 4]]) // returns Array [[1, 2], [3, 4]]
23
23
  * math.clone("hello world") // returns string "hello world"
@@ -24,7 +24,7 @@ export var createHasNumericValue = /* #__PURE__ */factory(name, dependencies, _r
24
24
  * math.hasNumericValue(0) // returns true
25
25
  * math.hasNumericValue(math.bignumber(500)) // returns true
26
26
  * math.hasNumericValue(math.fraction(4)) // returns true
27
- * math.hasNumericValue(math.complex('2-4i') // returns false
27
+ * math.hasNumericValue(math.complex('2-4i')) // returns false
28
28
  * math.hasNumericValue(false) // returns true
29
29
  * math.hasNumericValue([2.3, 'foo', false]) // returns [true, false, true]
30
30
  *
@@ -27,7 +27,7 @@ export var createIsInteger = /* #__PURE__ */factory(name, dependencies, _ref =>
27
27
  * math.isInteger(math.fraction(4)) // returns true
28
28
  * math.isInteger('3') // returns true
29
29
  * math.isInteger([3, 0.5, -2]) // returns [true, false, true]
30
- * math.isInteger(math.complex('2-4i') // throws an error
30
+ * math.isInteger(math.complex('2-4i')) // throws an error
31
31
  *
32
32
  * See also:
33
33
  *
@@ -27,7 +27,7 @@ export var createIsNaN = /* #__PURE__ */factory(name, dependencies, _ref => {
27
27
  * math.isNaN(math.bignumber(0)) // returns false
28
28
  * math.isNaN(math.fraction(-2, 5)) // returns false
29
29
  * math.isNaN('-2') // returns false
30
- * math.isNaN([2, 0, -3, NaN]') // returns [false, false, false, true]
30
+ * math.isNaN([2, 0, -3, NaN]) // returns [false, false, false, true]
31
31
  *
32
32
  * See also:
33
33
  *
@@ -27,7 +27,7 @@ export var createIsNegative = /* #__PURE__ */factory(name, dependencies, _ref =>
27
27
  * math.isNegative(math.bignumber(2)) // returns false
28
28
  * math.isNegative(math.fraction(-2, 5)) // returns true
29
29
  * math.isNegative('-2') // returns true
30
- * math.isNegative([2, 0, -3]') // returns [false, false, true]
30
+ * math.isNegative([2, 0, -3]) // returns [false, false, true]
31
31
  *
32
32
  * See also:
33
33
  *
@@ -24,7 +24,7 @@ export var createIsNumeric = /* #__PURE__ */factory(name, dependencies, _ref =>
24
24
  * math.isNumeric(0) // returns true
25
25
  * math.isNumeric(math.bignumber(500)) // returns true
26
26
  * math.isNumeric(math.fraction(4)) // returns true
27
- * math.isNumeric(math.complex('2-4i') // returns false
27
+ * math.isNumeric(math.complex('2-4i')) // returns false
28
28
  * math.isNumeric([2.3, 'foo', false]) // returns [true, false, true]
29
29
  *
30
30
  * See also:
@@ -27,7 +27,7 @@ export var createIsPositive = /* #__PURE__ */factory(name, dependencies, _ref =>
27
27
  * math.isPositive(0.5) // returns true
28
28
  * math.isPositive(math.bignumber(2)) // returns true
29
29
  * math.isPositive(math.fraction(-2, 5)) // returns false
30
- * math.isPositive(math.fraction(1,3)) // returns false
30
+ * math.isPositive(math.fraction(1, 3)) // returns true
31
31
  * math.isPositive('2') // returns true
32
32
  * math.isPositive([2, 0, -3]) // returns [true, false, false]
33
33
  *
@@ -21,17 +21,17 @@ export var createIsZero = /* #__PURE__ */factory(name, dependencies, _ref => {
21
21
  *
22
22
  * Examples:
23
23
  *
24
- * math.isZero(0) // returns true
25
- * math.isZero(2) // returns false
26
- * math.isZero(0.5) // returns false
27
- * math.isZero(math.bignumber(0)) // returns true
28
- * math.isZero(math.fraction(0)) // returns true
29
- * math.isZero(math.fraction(1,3)) // returns false
30
- * math.isZero(math.complex('2 - 4i') // returns false
31
- * math.isZero(math.complex('0i') // returns true
32
- * math.isZero('0') // returns true
33
- * math.isZero('2') // returns false
34
- * math.isZero([2, 0, -3]') // returns [false, true, false]
24
+ * math.isZero(0) // returns true
25
+ * math.isZero(2) // returns false
26
+ * math.isZero(0.5) // returns false
27
+ * math.isZero(math.bignumber(0)) // returns true
28
+ * math.isZero(math.fraction(0)) // returns true
29
+ * math.isZero(math.fraction(1,3)) // returns false
30
+ * math.isZero(math.complex('2 - 4i')) // returns false
31
+ * math.isZero(math.complex('0i')) // returns true
32
+ * math.isZero('0') // returns true
33
+ * math.isZero('2') // returns false
34
+ * math.isZero([2, 0, -3]) // returns [false, true, false]
35
35
  *
36
36
  * See also:
37
37
  *
@@ -1,2 +1,2 @@
1
- export var version = '11.0.0'; // Note: This file is automatically generated when building math.js.
1
+ export var version = '11.0.1'; // 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": "11.0.0",
3
+ "version": "11.0.1",
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",
package/types/index.d.ts CHANGED
@@ -890,8 +890,11 @@ declare namespace math {
890
890
  */
891
891
  simplify: Simplify
892
892
 
893
- simplifyConstant(expr: MathNode | string, options?: SimplifyOptions)
894
- simplifyCore(expr: MathNode | string, options?: SimplifyOptions)
893
+ simplifyConstant(
894
+ expr: MathNode | string,
895
+ options?: SimplifyOptions
896
+ ): MathNode
897
+ simplifyCore(expr: MathNode | string, options?: SimplifyOptions): MathNode
895
898
 
896
899
  /**
897
900
  * Replaces variable nodes with their scoped values
@@ -4407,11 +4410,12 @@ declare namespace math {
4407
4410
  * pass a custom set of rules to the function as second argument. A rule
4408
4411
  * can be specified as an object, string, or function.
4409
4412
  * @param scope Scope to variables
4413
+ * @param options Options to configure the behavior of simplify
4410
4414
  */
4411
4415
  simplify(
4412
4416
  this: MathJsChain<MathNode | string>,
4413
4417
  rules?: SimplifyRule[],
4414
- scope?: Map | object,
4418
+ scope?: Map<string, MathType> | object,
4415
4419
  options?: SimplifyOptions
4416
4420
  ): MathJsChain<MathNode>
4417
4421