mathjs 15.1.0 → 15.1.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.
Files changed (81) hide show
  1. package/HISTORY.md +12 -0
  2. package/NOTICE +1 -1
  3. package/README.md +6 -6
  4. package/bin/cli.js +1 -1
  5. package/lib/browser/math.js +1 -1
  6. package/lib/browser/math.js.LICENSE.txt +3 -3
  7. package/lib/browser/math.js.map +1 -1
  8. package/lib/cjs/core/function/import.js +7 -0
  9. package/lib/cjs/core/function/typed.js +1 -1
  10. package/lib/cjs/expression/parse.js +26 -2
  11. package/lib/cjs/function/algebra/polynomialRoot.js +4 -0
  12. package/lib/cjs/function/arithmetic/add.js +8 -1
  13. package/lib/cjs/function/arithmetic/cbrt.js +7 -6
  14. package/lib/cjs/function/arithmetic/ceil.js +10 -2
  15. package/lib/cjs/function/arithmetic/exp.js +7 -5
  16. package/lib/cjs/function/arithmetic/expm1.js +6 -5
  17. package/lib/cjs/function/arithmetic/fix.js +10 -2
  18. package/lib/cjs/function/arithmetic/floor.js +10 -2
  19. package/lib/cjs/function/arithmetic/log.js +13 -0
  20. package/lib/cjs/function/arithmetic/mod.js +8 -2
  21. package/lib/cjs/function/arithmetic/nthRoot.js +9 -3
  22. package/lib/cjs/function/arithmetic/nthRoots.js +7 -10
  23. package/lib/cjs/function/matrix/map.js +6 -0
  24. package/lib/cjs/function/relational/compare.js +6 -0
  25. package/lib/cjs/function/relational/compareNatural.js +8 -2
  26. package/lib/cjs/function/relational/deepEqual.js +8 -3
  27. package/lib/cjs/function/relational/equal.js +15 -2
  28. package/lib/cjs/function/relational/unequal.js +14 -2
  29. package/lib/cjs/function/set/setDistinct.js +2 -1
  30. package/lib/cjs/function/string/format.js +9 -0
  31. package/lib/cjs/function/utils/isFinite.js +8 -1
  32. package/lib/cjs/function/utils/numeric.js +6 -0
  33. package/lib/cjs/header.js +3 -3
  34. package/lib/cjs/type/bigint.js +5 -0
  35. package/lib/cjs/type/boolean.js +6 -0
  36. package/lib/cjs/type/complex/function/complex.js +6 -0
  37. package/lib/cjs/type/fraction/function/fraction.js +8 -0
  38. package/lib/cjs/type/matrix/function/index.js +8 -0
  39. package/lib/cjs/type/matrix/function/matrix.js +6 -0
  40. package/lib/cjs/type/matrix/function/sparse.js +4 -0
  41. package/lib/cjs/type/string.js +4 -0
  42. package/lib/cjs/type/unit/function/unit.js +8 -0
  43. package/lib/cjs/version.js +1 -1
  44. package/lib/esm/core/function/import.js +7 -0
  45. package/lib/esm/core/function/typed.js +1 -1
  46. package/lib/esm/expression/parse.js +26 -2
  47. package/lib/esm/function/algebra/polynomialRoot.js +4 -0
  48. package/lib/esm/function/arithmetic/add.js +8 -1
  49. package/lib/esm/function/arithmetic/cbrt.js +7 -6
  50. package/lib/esm/function/arithmetic/ceil.js +10 -2
  51. package/lib/esm/function/arithmetic/exp.js +7 -5
  52. package/lib/esm/function/arithmetic/expm1.js +6 -5
  53. package/lib/esm/function/arithmetic/fix.js +10 -2
  54. package/lib/esm/function/arithmetic/floor.js +10 -2
  55. package/lib/esm/function/arithmetic/log.js +13 -0
  56. package/lib/esm/function/arithmetic/mod.js +8 -2
  57. package/lib/esm/function/arithmetic/nthRoot.js +9 -3
  58. package/lib/esm/function/arithmetic/nthRoots.js +7 -10
  59. package/lib/esm/function/matrix/map.js +6 -0
  60. package/lib/esm/function/relational/compare.js +6 -0
  61. package/lib/esm/function/relational/compareNatural.js +8 -2
  62. package/lib/esm/function/relational/deepEqual.js +8 -3
  63. package/lib/esm/function/relational/equal.js +15 -2
  64. package/lib/esm/function/relational/unequal.js +14 -2
  65. package/lib/esm/function/set/setDistinct.js +2 -1
  66. package/lib/esm/function/string/format.js +9 -0
  67. package/lib/esm/function/utils/isFinite.js +8 -1
  68. package/lib/esm/function/utils/numeric.js +6 -0
  69. package/lib/esm/header.js +1 -1
  70. package/lib/esm/type/bigint.js +5 -0
  71. package/lib/esm/type/boolean.js +6 -0
  72. package/lib/esm/type/complex/function/complex.js +6 -0
  73. package/lib/esm/type/fraction/function/fraction.js +8 -0
  74. package/lib/esm/type/matrix/function/index.js +8 -0
  75. package/lib/esm/type/matrix/function/matrix.js +6 -0
  76. package/lib/esm/type/matrix/function/sparse.js +4 -0
  77. package/lib/esm/type/string.js +4 -0
  78. package/lib/esm/type/unit/function/unit.js +8 -0
  79. package/lib/esm/version.js +1 -1
  80. package/package.json +14 -14
  81. package/types/index.d.ts +45 -14
package/HISTORY.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # History
2
2
 
3
+ # 2026-02-10, 15.1.1
4
+
5
+ - Fix: #3631 Handle bigints in `compareNatural` (#3632). Thanks @Dheemanth07.
6
+ - Fix: #3578 interpret empty true-expr of conditional as error (#3581).
7
+ Thanks @gwhitney.
8
+ - Fix: #3597 added nullish type definitions (#3601). Thanks @Ayo1984.
9
+ - Docs: Correct several arithmetic and relational documentation examples
10
+ and add History (#3630). Thanks @Anadian.
11
+ - Docs: fix #3565, update Matrix documentation (#3591). Thanks @orelbn.
12
+ - Docs: #3341 add per-function HISTORY sections (#3606). Thanks @gwhitney.
13
+ - Docs: describe that `setDistinct` sorts the elements (see #3602).
14
+
3
15
  # 2025-11-05, 15.1.0
4
16
 
5
17
  - Feat: implement functions `isFinite` and `isBounded` (#3554, #3553).
package/NOTICE CHANGED
@@ -1,7 +1,7 @@
1
1
  math.js
2
2
  https://github.com/josdejong/mathjs
3
3
 
4
- Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
4
+ Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
5
5
 
6
6
  Licensed under the Apache License, Version 2.0 (the "License");
7
7
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -7,7 +7,7 @@ Math.js is an extensive math library for JavaScript and Node.js. It features a f
7
7
  [![Version](https://img.shields.io/npm/v/mathjs.svg)](https://www.npmjs.com/package/mathjs)
8
8
  [![Downloads](https://img.shields.io/npm/dm/mathjs.svg)](https://www.npmjs.com/package/mathjs)
9
9
  [![Build Status](https://github.com/josdejong/mathjs/workflows/Node.js%20CI/badge.svg)](https://github.com/josdejong/mathjs/actions)
10
- [![Maintenance](https://img.shields.io/maintenance/yes/2025.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity)
10
+ [![Maintenance](https://img.shields.io/maintenance/yes/2026.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity)
11
11
  [![License](https://img.shields.io/github/license/josdejong/mathjs.svg)](https://github.com/josdejong/mathjs/blob/master/LICENSE)
12
12
  [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fjosdejong%2Fmathjs?ref=badge_shield)
13
13
  [![Codecov](https://codecov.io/gh/josdejong/mathjs/branch/develop/graph/badge.svg)](https://codecov.io/gh/josdejong/mathjs)
@@ -133,7 +133,7 @@ At the lowest level, mathjs has immutable factory functions which create immutab
133
133
  A common case is to implement a new function. This involves the following steps:
134
134
 
135
135
  - Implement the function in the right category, for example `./src/function/arithmetic/myNewFunction.js`, where you can replace `arithmetic` with the proper category, and `myNewFunction` with the name of the new function. Add the new function to the index files `./src/factoriesAny.js` and possibly `./src/factoriesNumber.js`.
136
- - Write documentation on the function in the source code comment of `myNewFunction.js`. This documentation is used to auto generate documentation on the website.
136
+ - Write documentation on the function in the source code comment of `myNewFunction.js`. This documentation is used to auto generate documentation on the website. It should include a History section with one line, indicating the upcoming version number in which the function will be created.
137
137
  - Write embedded documentation for the new function in `./src/expression/embeddedDocs/function/arithmetic/myNewFunction.js`. Add the new documentation to the index file `./src/expression/embeddedDocs/embeddedDocs.js`.
138
138
  - Write unit tests for the function in `./test/unit-tests/function/arithmetic/myNewFunction.test.js`.
139
139
  - Write the necessary TypeScript definitions for the new function in `./types/index.d.ts`, and write tests for it in `./test/typescript-tests/testTypes.ts`. This is described in [./types/EXPLANATION.md](./types/EXPLANATION.md) -- make sure to read that page, as Typescript definitions must be added in _multiple_ places in the code.
@@ -191,18 +191,18 @@ To see the coverage results, open the generated report in your browser:
191
191
 
192
192
  ### Continuous integration testing
193
193
 
194
- Continuous integration tests are run on [Github Actions](https://github.com/josdejong/mathjs/actions) and [LambdaTest](https://www.lambdatest.com) every time a commit is pushed to github. Github Actions runs the tests for different versions of node.js, and LambdaTest runs the tests on all major browsers.
194
+ Continuous integration tests are run on [GitHub Actions](https://github.com/josdejong/mathjs/actions) and [TestMu AI](https://www.testmu.ai) (formerly LambdaTest) every time a commit is pushed to GitHub. GitHub Actions runs the tests for different versions of node.js, and TestMu AI runs the tests on all major browsers.
195
195
 
196
- [![LambdaTest](https://raw.github.com/josdejong/mathjs/master/misc/lambdatest.svg)](https://www.lambdatest.com)
196
+ [![TestMu AI](https://raw.github.com/josdejong/mathjs/develop/misc/testmu-ai.svg)](https://www.testmu.ai)
197
197
 
198
- Thanks, GitHub Actions and LambdaTest for the generous free hosting of this open source project!
198
+ Thanks, GitHub Actions and TestMu AI for the generous free hosting of this open source project!
199
199
 
200
200
  ## License
201
201
 
202
202
  mathjs is published under the Apache 2.0 license:
203
203
 
204
204
  ```
205
- Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
205
+ Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
206
206
 
207
207
  Licensed under the Apache License, Version 2.0 (the "License");
208
208
  you may not use this file except in compliance with the License.
package/bin/cli.js CHANGED
@@ -30,7 +30,7 @@
30
30
  * cat script.txt | mathjs > results.txt Run input stream, output to file
31
31
  *
32
32
  * @license
33
- * Copyright (C) 2013-2025 Jos de Jong <wjosdejong@gmail.com>
33
+ * Copyright (C) 2013-2026 Jos de Jong <wjosdejong@gmail.com>
34
34
  *
35
35
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
36
36
  * use this file except in compliance with the License. You may obtain a copy