mathjs 14.0.1 → 14.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. package/HISTORY.md +20 -0
  2. package/NOTICE +1 -1
  3. package/README.md +7 -7
  4. package/bin/cli.js +1 -1
  5. package/lib/browser/math.js +1 -1
  6. package/lib/browser/math.js.LICENSE.txt +5 -5
  7. package/lib/browser/math.js.map +1 -1
  8. package/lib/cjs/core/function/import.js +14 -4
  9. package/lib/cjs/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  10. package/lib/cjs/entry/dependenciesAny/{dependenciesApply.generated.js → dependenciesMapSlices.generated.js} +3 -3
  11. package/lib/cjs/entry/dependenciesAny/{dependenciesApplyTransform.generated.js → dependenciesMapSlicesTransform.generated.js} +3 -3
  12. package/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeq.generated.js +2 -0
  13. package/lib/cjs/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js +2 -0
  14. package/lib/cjs/entry/dependenciesAny/dependenciesRandomInt.generated.js +2 -0
  15. package/lib/cjs/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  16. package/lib/cjs/entry/dependenciesAny/dependenciesVariance.generated.js +2 -2
  17. package/lib/cjs/entry/dependenciesAny/dependenciesVarianceTransform.generated.js +2 -2
  18. package/lib/cjs/entry/dependenciesAny.generated.js +14 -14
  19. package/lib/cjs/entry/dependenciesNumber/{dependenciesApply.generated.js → dependenciesMapSlices.generated.js} +3 -3
  20. package/lib/cjs/entry/dependenciesNumber/{dependenciesApplyTransform.generated.js → dependenciesMapSlicesTransform.generated.js} +3 -3
  21. package/lib/cjs/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js +2 -0
  22. package/lib/cjs/entry/dependenciesNumber/dependenciesRandomInt.generated.js +2 -0
  23. package/lib/cjs/entry/dependenciesNumber/dependenciesVariance.generated.js +2 -2
  24. package/lib/cjs/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js +2 -2
  25. package/lib/cjs/entry/dependenciesNumber.generated.js +14 -14
  26. package/lib/cjs/entry/impureFunctionsAny.generated.js +86 -85
  27. package/lib/cjs/entry/impureFunctionsNumber.generated.js +14 -14
  28. package/lib/cjs/entry/pureFunctionsAny.generated.js +330 -325
  29. package/lib/cjs/entry/pureFunctionsNumber.generated.js +18 -15
  30. package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +2 -0
  31. package/lib/cjs/expression/embeddedDocs/function/arithmetic/sign.js +1 -1
  32. package/lib/cjs/expression/embeddedDocs/function/matrix/mapSlices.js +17 -0
  33. package/lib/cjs/expression/transform/index.transform.js +2 -2
  34. package/lib/cjs/expression/transform/{apply.transform.js → mapSlices.transform.js} +11 -10
  35. package/lib/cjs/expression/transform/quantileSeq.transform.js +5 -3
  36. package/lib/cjs/expression/transform/variance.transform.js +3 -3
  37. package/lib/cjs/factoriesAny.js +14 -14
  38. package/lib/cjs/factoriesNumber.js +16 -15
  39. package/lib/cjs/function/arithmetic/ceil.js +34 -26
  40. package/lib/cjs/function/arithmetic/fix.js +3 -0
  41. package/lib/cjs/function/arithmetic/floor.js +41 -26
  42. package/lib/cjs/function/arithmetic/log.js +12 -5
  43. package/lib/cjs/function/arithmetic/log10.js +15 -7
  44. package/lib/cjs/function/arithmetic/log2.js +9 -4
  45. package/lib/cjs/function/arithmetic/round.js +4 -0
  46. package/lib/cjs/function/matrix/ctranspose.js +1 -1
  47. package/lib/cjs/function/matrix/{apply.js → mapSlices.js} +19 -12
  48. package/lib/cjs/function/matrix/matrixFromFunction.js +36 -3
  49. package/lib/cjs/function/matrix/range.js +54 -5
  50. package/lib/cjs/function/probability/randomInt.js +26 -3
  51. package/lib/cjs/function/relational/larger.js +12 -4
  52. package/lib/cjs/function/relational/smaller.js +12 -4
  53. package/lib/cjs/function/statistics/max.js +1 -1
  54. package/lib/cjs/function/statistics/min.js +1 -1
  55. package/lib/cjs/function/statistics/quantileSeq.js +4 -9
  56. package/lib/cjs/function/statistics/variance.js +3 -3
  57. package/lib/cjs/function/string/hex.js +1 -1
  58. package/lib/cjs/function/string/print.js +2 -2
  59. package/lib/cjs/function/trigonometry/acoth.js +1 -1
  60. package/lib/cjs/function/trigonometry/acsc.js +1 -1
  61. package/lib/cjs/function/trigonometry/asin.js +1 -1
  62. package/lib/cjs/function/trigonometry/atan2.js +2 -1
  63. package/lib/cjs/function/trigonometry/cos.js +1 -1
  64. package/lib/cjs/function/trigonometry/sin.js +1 -1
  65. package/lib/cjs/function/utils/isInteger.js +1 -1
  66. package/lib/cjs/header.js +3 -3
  67. package/lib/cjs/type/matrix/MatrixIndex.js +6 -3
  68. package/lib/cjs/type/matrix/Range.js +15 -8
  69. package/lib/cjs/utils/bigint.js +33 -0
  70. package/lib/cjs/utils/factory.js +5 -2
  71. package/lib/cjs/utils/number.js +7 -19
  72. package/lib/cjs/utils/snapshot.js +8 -1
  73. package/lib/cjs/version.js +1 -1
  74. package/lib/esm/core/function/import.js +14 -4
  75. package/lib/esm/entry/dependenciesAny/dependenciesLarger.generated.js +2 -0
  76. package/lib/esm/entry/{dependenciesNumber/dependenciesApply.generated.js → dependenciesAny/dependenciesMapSlices.generated.js} +3 -3
  77. package/lib/esm/entry/{dependenciesNumber/dependenciesApplyTransform.generated.js → dependenciesAny/dependenciesMapSlicesTransform.generated.js} +3 -3
  78. package/lib/esm/entry/dependenciesAny/dependenciesQuantileSeq.generated.js +2 -0
  79. package/lib/esm/entry/dependenciesAny/dependenciesQuantileSeqTransform.generated.js +2 -0
  80. package/lib/esm/entry/dependenciesAny/dependenciesRandomInt.generated.js +2 -0
  81. package/lib/esm/entry/dependenciesAny/dependenciesSmaller.generated.js +2 -0
  82. package/lib/esm/entry/dependenciesAny/dependenciesVariance.generated.js +2 -2
  83. package/lib/esm/entry/dependenciesAny/dependenciesVarianceTransform.generated.js +2 -2
  84. package/lib/esm/entry/dependenciesAny.generated.js +2 -2
  85. package/lib/esm/entry/{dependenciesAny/dependenciesApply.generated.js → dependenciesNumber/dependenciesMapSlices.generated.js} +3 -3
  86. package/lib/esm/entry/{dependenciesAny/dependenciesApplyTransform.generated.js → dependenciesNumber/dependenciesMapSlicesTransform.generated.js} +3 -3
  87. package/lib/esm/entry/dependenciesNumber/dependenciesQuantileSeq.generated.js +2 -0
  88. package/lib/esm/entry/dependenciesNumber/dependenciesRandomInt.generated.js +2 -0
  89. package/lib/esm/entry/dependenciesNumber/dependenciesVariance.generated.js +2 -2
  90. package/lib/esm/entry/dependenciesNumber/dependenciesVarianceTransform.generated.js +2 -2
  91. package/lib/esm/entry/dependenciesNumber.generated.js +2 -2
  92. package/lib/esm/entry/impureFunctionsAny.generated.js +88 -87
  93. package/lib/esm/entry/impureFunctionsNumber.generated.js +16 -16
  94. package/lib/esm/entry/pureFunctionsAny.generated.js +328 -323
  95. package/lib/esm/entry/pureFunctionsNumber.generated.js +17 -14
  96. package/lib/esm/expression/embeddedDocs/embeddedDocs.js +2 -0
  97. package/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js +1 -1
  98. package/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js +11 -0
  99. package/lib/esm/expression/transform/index.transform.js +3 -3
  100. package/lib/esm/expression/transform/mapSlices.transform.js +47 -0
  101. package/lib/esm/expression/transform/quantileSeq.transform.js +5 -3
  102. package/lib/esm/expression/transform/variance.transform.js +3 -3
  103. package/lib/esm/factoriesAny.js +2 -2
  104. package/lib/esm/factoriesNumber.js +2 -2
  105. package/lib/esm/function/arithmetic/ceil.js +35 -27
  106. package/lib/esm/function/arithmetic/fix.js +3 -0
  107. package/lib/esm/function/arithmetic/floor.js +42 -27
  108. package/lib/esm/function/arithmetic/log.js +12 -5
  109. package/lib/esm/function/arithmetic/log10.js +16 -8
  110. package/lib/esm/function/arithmetic/log2.js +9 -4
  111. package/lib/esm/function/arithmetic/round.js +4 -0
  112. package/lib/esm/function/matrix/ctranspose.js +1 -1
  113. package/lib/esm/function/matrix/{apply.js → mapSlices.js} +18 -11
  114. package/lib/esm/function/matrix/matrixFromFunction.js +36 -3
  115. package/lib/esm/function/matrix/range.js +54 -5
  116. package/lib/esm/function/probability/randomInt.js +26 -3
  117. package/lib/esm/function/relational/larger.js +12 -4
  118. package/lib/esm/function/relational/smaller.js +12 -4
  119. package/lib/esm/function/statistics/max.js +1 -1
  120. package/lib/esm/function/statistics/min.js +1 -1
  121. package/lib/esm/function/statistics/quantileSeq.js +4 -9
  122. package/lib/esm/function/statistics/variance.js +3 -3
  123. package/lib/esm/function/string/hex.js +1 -1
  124. package/lib/esm/function/string/print.js +2 -2
  125. package/lib/esm/function/trigonometry/acoth.js +1 -1
  126. package/lib/esm/function/trigonometry/acsc.js +1 -1
  127. package/lib/esm/function/trigonometry/asin.js +1 -1
  128. package/lib/esm/function/trigonometry/atan2.js +2 -1
  129. package/lib/esm/function/trigonometry/cos.js +1 -1
  130. package/lib/esm/function/trigonometry/sin.js +1 -1
  131. package/lib/esm/function/utils/isInteger.js +1 -1
  132. package/lib/esm/header.js +1 -1
  133. package/lib/esm/type/matrix/MatrixIndex.js +6 -3
  134. package/lib/esm/type/matrix/Range.js +16 -9
  135. package/lib/esm/utils/bigint.js +27 -0
  136. package/lib/esm/utils/factory.js +5 -2
  137. package/lib/esm/utils/number.js +6 -17
  138. package/lib/esm/utils/snapshot.js +8 -1
  139. package/lib/esm/version.js +1 -1
  140. package/package.json +13 -11
  141. package/types/index.d.ts +75 -12
  142. package/lib/esm/expression/transform/apply.transform.js +0 -44
package/HISTORY.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # History
2
2
 
3
+ # 2024-01-30, 14.2.0
4
+
5
+ - Feat: #3041, #3340 rename `apply` to `mapSlices` (#3357). Function
6
+ `apply` is still available but is now marked deprecated. Thanks @gwhitney.
7
+ - Fix: #3247 don't override type-native floor/ceil within tolerance of value
8
+ (#3369). Thanks @gwhitney.
9
+ - Fix: #3360 add bigint support to matrix indices and ranges (#3361).
10
+ Thanks @gwhitney.
11
+ - Fix: #3115 type definitions for matrixFrom* (#3371). Thanks @Hudsxn
12
+ and @gwhitney.
13
+
14
+ # 2025-01-24, 14.1.0
15
+
16
+ - Feat: implement `bigint` support in functions `log`, `log2`, `log10`,
17
+ `larger`, `smaller`, `max`, `min` (#3345). Thanks @gwhitney.
18
+ - Fix: #3342 hexadecimal input not turned into a `bigint` (#3348).
19
+ - Fix `randomInt()` not working (#3345).
20
+ - Docs: fixed description of `sign` in the embedded docs (#3338).
21
+ Thanks @witer33.
22
+
3
23
  # 2024-12-11, 14.0.1
4
24
 
5
25
  - Fix: make derivative much faster (#3322). Thanks @paulftw.
package/NOTICE CHANGED
@@ -1,7 +1,7 @@
1
1
  math.js
2
2
  https://github.com/josdejong/mathjs
3
3
 
4
- Copyright (C) 2013-2024 Jos de Jong <wjosdejong@gmail.com>
4
+ Copyright (C) 2013-2025 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/2024.svg)](https://github.com/josdejong/mathjs/graphs/commit-activity)
10
+ [![Maintenance](https://img.shields.io/maintenance/yes/2025.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)
@@ -168,9 +168,9 @@ Additionally, the tests can be run on FireFox using [headless mode](https://deve
168
168
 
169
169
  npm run test:browser
170
170
 
171
- To run the tests remotely on BrowserStack, first set the environment variables `BROWSER_STACK_USERNAME` and `BROWSER_STACK_ACCESS_KEY` with your username and access key and then execute:
171
+ To run the tests remotely on LambdaTest, first set the environment variables `LT_USERNAME` and `LT_ACCESS_KEY` with your username and access key and then execute:
172
172
 
173
- npm run test:browserstack
173
+ npm run test:lambdatest
174
174
 
175
175
  You can separately run the code linter, though it is also executed with `npm test`:
176
176
 
@@ -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 [BrowserStack](https://www.browserstack.com) every time a commit is pushed to github. Github Actions runs the tests for different versions of node.js, and BrowserStack runs the tests on all major browsers.
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.
195
195
 
196
- [![BrowserStack](https://raw.github.com/josdejong/mathjs/master/misc/browserstack.png)](https://www.browserstack.com)
196
+ [![LambdaTest](https://raw.github.com/josdejong/mathjs/master/misc/lambdatest.svg)](https://www.lambdatest.com)
197
197
 
198
- Thanks Github Actions and BrowserStack for the generous free hosting of this open source project!
198
+ Thanks, GitHub Actions and LambdaTest 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-2024 Jos de Jong <wjosdejong@gmail.com>
205
+ Copyright (C) 2013-2025 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-2024 Jos de Jong <wjosdejong@gmail.com>
33
+ * Copyright (C) 2013-2025 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