4950 Commits

Author SHA1 Message Date
Jos de Jong
2c819ea9f0 Merge remote-tracking branch 'origin/develop' into develop 2023-08-30 11:27:33 +02:00
Jos de Jong
386c280280 docs: define see also sections for erf and zeta 2023-08-30 11:25:48 +02:00
Carl Osterwisch
49a19cad3b
Energy prefixes (#3019)
* Enable short and long prefixes for the erg unit of energy

* Use long prefixes instead of short for the joule unit of energy

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-08-30 11:04:38 +02:00
Jos de Jong
7e35dad058 fix linting issues 2023-08-30 10:57:39 +02:00
Jos de Jong
df4ac5abf3 fix #3020: lruQueue using the global hasOwnProperty which may be polluted 2023-08-30 10:50:03 +02:00
Jos de Jong
c4926ce56f chore: publish v11.10.0 v11.10.0 2023-08-23 15:56:47 +02:00
Jos de Jong
a21d46ead1 Merge remote-tracking branch 'origin/develop' into develop 2023-08-23 15:50:45 +02:00
Jos de Jong
e36f90e1a8
Implement function Riemann Zeta (#2975, #2950)
* Riemann Zeta Function

* Big Number zeta and added docs

* Original algorithm paper credited

* Update index.d.ts

* Update riemannZeta.js

* Update index.d.ts

* Renamed files to reflect zeta

* chore: make all the tests pass

* chore: refactor `zeta` (WIP)

* chore: reuse the validation logic of both number and BigNumber

* fix: type definitions of `zeta`

* fix: test the accuracy with numbers and BigNumbers (WIP)

* chore: make linter happy

* docs: fix example outputs

* docs: update history

* docs: update history

* docs: describe the limited precision of `zeta`

---------

Co-authored-by: BuildTools <anikpatel1322@gmail.com>
Co-authored-by: Anik Patel <74193405+Bobingstern@users.noreply.github.com>
2023-08-23 15:50:11 +02:00
Jos de Jong
44c771ab55 docs: update history 2023-08-23 12:39:12 +02:00
Jos de Jong
df61fdbcd3 Merge remote-tracking branch 'origin/develop' into develop 2023-08-23 12:37:04 +02:00
David Contreras
3ab9bc1ea3
Extend quantileSeq with support for a dimension (#3002)
* Included math to syntax when missing

* Included solveODE

* renamed initialStep as firstStep

* Included tests for solveODE

* Test the full state instead of the final state

* Fixed issue with tolerance

* Added unit signature for y0

* Included units test also for y0

* Included embedded docs and more tests

* Included error for tspan

* It works with bignumbers

* reduced calling bignumber

* extended the search for bignumbers

* The jsdocs is less ambiguous

* included tests for step options

* Allowed for 0 minStep

* Optimization to avoid checking the sign every step

* added dim to quantile

* Included transform

* Removed modification of the docs

I made an unwanted modification

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-08-23 12:36:54 +02:00
Jos de Jong
1b99535785 docs: update history 2023-07-28 09:33:09 +02:00
David Contreras
49c793ba5a
feat: Indexing with an array of booleans (#2994)
* Included math to syntax when missing

* Included solveODE

* renamed initialStep as firstStep

* Included tests for solveODE

* Test the full state instead of the final state

* Fixed issue with tolerance

* Indexing with an array of booleans

* Indexing with booleans and with empty

* Changed index embedded docs

* removed solveODE

* typos on tests

* included config.predictable

* Throws an error if the size doesn't match

* Included config predictable to get subset

* Can do replacement by broadcasting

* DenseMatrix set can broadcast first

* Added tests for broadcasted subset in the parser

* Faster cloning of deep arrays

* Included docs and better test coverage

* Test coverage for `subset`

* Removed config predictable from subset

* Removed config from index and sparseMatrix

* Redaction and typos

* Cleanup unnecesary changes

* fixed issue when there is no need to broadcast

* Inline ifs

* Included specific broadcasting test

* Reduced repetition

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-07-28 09:30:04 +02:00
Jos de Jong
202c07e021 docs: update history 2023-07-27 12:15:09 +02:00
Jos de Jong
a30d1f8ce6
fix: #2990 DenseMatrix can mutate input arrays (#2991)
* fix: #2990 DenseMatrix can mutate input arrays

* chore: simplify internal function `preprocess`

* chore: document ugly workaround of using `matrix.subset` to mutate a nested Array

* chore: better solution for `assign`

* chore: fix linting issue

* chore: add a unit test for `multiply` testing whether the operation is immutable

* chore: fix linting issue

---------

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
2023-07-27 11:42:36 +02:00
Jos de Jong
563ff63ec0 chore: publish v11.9.1 v11.9.1 2023-07-24 12:37:21 +02:00
Jos de Jong
6dcbc6b793 fix: security vulnerability in FunctionNode and SymbolNode allowing arbitrary code execution via math.evaluate 2023-07-24 12:33:28 +02:00
Jos de Jong
d0d11a2f01 fix #3001: mathjs bundle containing new Function(...) (CSP issue) 2023-07-20 12:45:00 +02:00
Jos de Jong
5477d3829f chore: update devDependencies 2023-07-19 15:15:22 +02:00
Jos de Jong
7f6b4f9ca6 chore: publish v11.9.0 v11.9.0 2023-07-19 14:09:22 +02:00
Jos de Jong
b2a606b03a Merge remote-tracking branch 'origin/develop' into develop 2023-07-19 14:05:09 +02:00
Jos de Jong
8855ba522b docs: update HISTORY.md 2023-07-19 11:57:22 +02:00
David Contreras
8fe5e517d6
feat: support units in range (#2997)
* reange refactoring

* update authors

* Made _range to work also for _bigNumbers

* Range with units

* Included some Unit type in _range

* Included TypeScript types for function range

* Formatting

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
2023-07-19 11:55:53 +02:00
Jos de Jong
14614f2183 chore: update history and authors 2023-07-13 17:27:58 +02:00
Aly Khaled
8475ab997b
zpk2tf and freqz functions implementation (#2988)
* Add Zpk2tf function

* Add zpk2tf function documentation

* Fix

* Add freqz function implementation

* Fix format

* Add freqz function documentation

* Fix

* Fix format

* Update index.d.ts

* Fix Dependency error

* Fix

* Fix index.d.ts

* Fix Documentation

* Fix Lint

* Fix index.d.ts

* Fix The Matrix parameter support and index.d.ts

* Fix Format

* Add Unit Tests for Matrix cases

* Fix Docs and Lint

* Add tests for coverage

* Fix Format

* Update AUTHORS

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-07-13 17:23:50 +02:00
David Contreras
7923d58e2e
Range refactoring (#2995)
* reange refactoring

* update authors

* Made _range to work also for _bigNumbers

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-07-13 17:02:18 +02:00
Jos de Jong
ab409dffeb chore: ignore freqz in the doc test for the time being (see #2988) 2023-07-13 16:48:04 +02:00
Jos de Jong
6169f0a8a5 docs: update HISTORY.md 2023-07-12 15:03:31 +02:00
David Contreras
1aed900cc0
feat: implement solveODE (#2958)
* Included math to syntax when missing

* Included solveODE

* renamed initialStep as firstStep

* Included tests for solveODE

* Test the full state instead of the final state

* Fixed issue with tolerance

* Added unit signature for y0

* Included units test also for y0

* Included embedded docs and more tests

* Included error for tspan

* It works with bignumbers

* reduced calling bignumber

* extended the search for bignumbers

* The jsdocs is less ambiguous

* included tests for step options

* Allowed for 0 minStep

* Optimization to avoid checking the sign every step

---------

Co-authored-by: David Contreras <david.contreras@guentner.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-07-12 14:28:10 +02:00
Jos de Jong
f48caf9f50 docs: don't check expected result of an example when we don't know the expected result 2023-07-12 14:15:57 +02:00
Jos de Jong
f0b87e435e chore: update HISTORY.md 2023-07-12 13:23:54 +02:00
Carl Osterwisch
a1e6e9301e
fix: nearly-zero temperature conversion result (#2962)
* Test for roundoff error due to offset

* Set result to exactly 0 if it is within config.epsilon of 0

* Add more offset conversion tests

* Represent degR unit value as a Fraction(5, 9)

* Accurately convert from fraction to bignumber

* Add more tests demonstrating the improved offset conversions

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-07-12 13:21:56 +02:00
Jos de Jong
47bf525e3e chore: update history 2023-07-10 09:12:52 +02:00
Jos de Jong
bc9f4d6243 fix: #2996 two errors in the examples in the documentation about Expression trees 2023-07-10 09:11:57 +02:00
Jos de Jong
fd99219cef docs: update HISTORY.md 2023-07-05 13:55:05 +02:00
MaybePixem
aa819fac6a
fix: #2974 Simplify puts plus and minus signs next to eachother (#2981)
* adjust simplify rules

* fix formatting

* move rule back

* move rule
2023-07-05 13:54:01 +02:00
Jos de Jong
bf911816d3 chore: update history 2023-06-21 10:56:22 +02:00
Jos de Jong
19a1938e1a docs: improve embedded docs of evaluate 2023-06-21 10:56:15 +02:00
David Contreras
5b501f277b
Issues with embedded docs examples (#2976)
* Included math to syntax when missing

* Fixed examples in embedded docs
2023-06-21 10:47:45 +02:00
Jos de Jong
bb2f3cc3ed chore: publish v11.8.2 v11.8.2 2023-06-20 12:16:18 +02:00
Jos de Jong
e13be73993 docs: update HISTORY.md 2023-06-20 12:13:13 +02:00
Jos de Jong
1d96483940 chore: update devDependencies 2023-06-20 11:59:20 +02:00
Jos de Jong
6db3df2eee fix: #2972 type definitions of Unit.divide(Unit) have a wrong return type 2023-06-20 11:40:40 +02:00
Jos de Jong
29db0fb288 fix: #2971 improve typings of statistics functions min, max, mean, median, mode, std, sum, prod, variance 2023-06-20 11:33:38 +02:00
Jos de Jong
6d944e7dfb chore: publish v11.8.1 v11.8.1 2023-06-13 12:04:35 +02:00
Jos de Jong
91c18ae13f chore: update devDependencies 2023-06-13 12:01:49 +02:00
Jos de Jong
cc4f8b6056 chore: update history and authors 2023-06-13 11:48:46 +02:00
Kiku
1b06ec4b81
fix #2964: distance from point to line (#2965)
some additional unit tests, types and doc fix for distance function

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-06-13 11:02:57 +02:00
Michael Greminger
6fa589057e
Big Number Format Fixes (#2956)
* test: format bignumber to engineering bug

Add tests for correctly handling starting with more then 3 sig figs and targeting 1 or 2 sig figs

* lint:

* lint: reduce number literal sig figs

* fix: engineering notation for bignumber input

Corrects handling of cases where the input has 3 or more sig figs and the output is set to 1 or 2 sig figs.

* test: add negative format bignumber precision test

* fix: use BigNumber for all branches in toEngineering

Also, remove string type option from JSDoc for toEngineering since string does support the required interface for the function (the .e property, .mul member function, and the .constructor property would not be correct after this change)

* fix: precision 0 for fixed notation and bignumber

This fix differentiates precision === 0 and precision === undefined to.
After fix, format bignumber for precision 0 matches format number for precision 0.

Tests added as well

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2023-06-13 10:39:44 +02:00
Jos de Jong
3c59d1a9ca
fix: #2880 not possible to map cube root cbrt (#2966)
* fix: #2880 not possible to map cube root `cbrt`

* fix: bind signature, add comments
2023-06-08 10:04:29 +02:00