24 Commits

Author SHA1 Message Date
Orel Ben Neriah
4039df04ca
fix: #3387 use utility isNaN for consistent max and min results (#3389)
* fix: use utility isNaN for consistent max and min results

* test: add NaN comparison cases for larger and smaller functions

* docs: update descriptions for larger, smaller, max, and min functions to clarify NaN behavior

* refactor: rename isNaN to mathIsNaN for extra clarity

---------

Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-02-28 15:19:28 +01:00
Glen Whitney
8510b850ad
fix: handle bigints properly in more cases (#3345)
* fix: Handle bigints properly in more cases
  * Allow a bigint to appear in a max/min of nonhomogeneous arguments
  * If randomInt is called with a bigint or a pair of bigints, return
    a bigint.
  * Preserve uniformity of results if randomInt is called with a very large
    range.
  * Extend log, log2, and log10 to bigints
  * Add tests for all of the above issues.
  * Bonus: fix one JSDoc comment issue. If every PR fixes one, we will soon
    get through the 150+

* fix: Refactors per comments and 1 bonus doc test (isInteger)

* chore: fix lint

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-01-24 10:59:13 +01:00
Jos de Jong
ab3461d484
feat: implement support for bigint (#3207, #2737) 2024-05-31 12:43:09 +02:00
Jos de Jong
1f05a35d68
chore: convert CJS files to ESM (#3204) 2024-05-22 08:46:14 +02:00
Jos de Jong
f504ffe1d3 chore: update devDependencies (most notably eslint) 2024-02-22 16:27:24 +01:00
Jos de Jong
3d84b5b594 fix #3092: a typo in an error message when converting a string into a number 2023-11-09 09:25:43 +01:00
Vrushaket Chaudhari
abf9c9fade
fixed matrix issue in correlation function + error handling (#3030)
* fixed matrix issue in correlation function + error handling

* fixed syntax error in correlation function documentation

* changed error to syntax error

* added test cases for error handling

* added test cases for error handling v2

* fixed issue in test cases for error handling v2

* fixed issue in test cases for error handling v2.1

* fixed issue in test cases for error handling v2.2

* removed math.matrix examples

* removed redundant code
2023-09-20 11:26:37 +02:00
Vrushaket Chaudhari
1ee8733832
added correlation function to statistics (#3015)
* added correlation function to statistics

* added implemenation for signature Matrix, Matrix and support for BigNumbers

* reverted changes to default for version numbers of devDepenencies

* reverted changes to default for version numbers of devDepenencies in package-lock.json

* change variable name from xArray, yArray to x and y

* added Matrix as param in index.d.ts

* corrected the file and function names for correlation function

* renamed createCorrelation to createCorr in factoriesNumber.js

* fixed failing test case for matrix and added params and return in corr
2023-09-01 13:38:49 +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
99829d311b fix linting issue 2023-02-23 17:08:48 +01:00
Jos de Jong
f865658339 fix: quantileSeq not accepting a matrix as second argument prob (see #2902) 2023-02-23 16:48:56 +01:00
Chris Chudzicki
13a3d4c198
Linting: StandardJS for src/, test/; Prettier for types/ (#2544)
* setup linting with eslint-config-standard, prettier

* [autofix] npm run lint -- --fix with new setup

* [manual] fix types/ directory errors

* [manual] fix linting errors in test/ directory

* [manual] fix single linting error in src/

* revert ts-expect-error comment change

* error on .only in mocha tests

* fix test description typo

* move some short objects to single line

* add and gitignore eslintcache

* individually suppress ts any

* set --max-warnings to 0

* extract matrices to constants

* update ts-expect-error comments
2022-04-29 12:04:01 +02:00
Jos de Jong
c957d41053
Implement cumsum function for computing cumulative sums (#1870)
Resolves #1633

Co-authored-by: Hjortur Jonasson <hjorturjonasson@gmail.com>
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
2022-03-05 23:06:51 -08:00
Jos de Jong
6f00715754
Specify import require paths (continuation of #1941) (#1962)
* Add `.js` extension to source file imports

* Specify package `exports` in `package.json`

Specify package type as `commonjs` (It's good to be specific)

* Move all compiled scripts into `lib` directory

Remove ./number.js (You can use the compiled ones in `./lib/*`)

Tell node that the `esm` directory is type `module` and enable tree shaking.

Remove unused files from packages `files` property

* Allow importing of package.json

* Make library ESM first

* - Fix merge conflicts
- Refactor `bundleAny` into `defaultInstance.js` and `browserBundle.cjs`
- Refactor unit tests to be able to run with plain nodejs (no transpiling)
- Fix browser examples

* Fix browser and browserstack tests

* Fix running unit tests on Node 10 (which has no support for modules)

* Fix node.js examples (those are still commonjs)

* Remove the need for `browserBundle.cjs`

* Generate minified bundle only

* [Security] Bump node-fetch from 2.6.0 to 2.6.1 (#1963)

Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. **This update includes a security fix.**
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

* Cleanup console.log

* Add integration tests to test the entry points (commonjs/esm, full/number only)

* Create backward compatibility error messages in the files moved/removed since v8

* Describe breaking changes in HISTORY.md

* Bump karma from 5.2.1 to 5.2.2 (#1965)

Bumps [karma](https://github.com/karma-runner/karma) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v5.2.1...v5.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>

Co-authored-by: Lee Langley-Rees <lee@greenimp.co.uk>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-09-20 18:01:29 +02:00
rnd-debug
d08f2bc893
enable variance() and std() to use arrays with units (#1959) 2020-09-06 09:29:25 +02:00
josdejong
719fc80999 Fix unit test 2020-06-24 09:48:20 +02:00
josdejong
c19492a3c9 Fix functions sum, prod, min, and max not throwing a conversion error when passing a single string, like sum("abc") 2020-06-24 09:47:46 +02:00
josdejong
eef3b9e612 Fix prod("abc") not throwing a conversion error 2020-06-23 20:30:20 +02:00
josdejong
0ae2d49232 Fix sum("abc") not throwing a conversion error 2020-06-23 20:21:07 +02:00
josdejong
23e38bea60 Remove all deprecated code and warnings 2020-05-06 21:57:33 +02:00
Clinton Curry
69dd165afb Allow taking means of quantities with units. (#1644)
* Allow taking means of quantities with units.

* Fix silly error in test.

The test as written did not test anything about units.

* Fix same error again...
2019-10-03 20:28:25 +02:00
Harry Sarson
b6a42c032d run standard --fix 2019-08-21 10:09:10 +01:00
jos
d8a4f3a00a Update to standard@13.0.2 2019-07-20 13:46:31 +02:00
jos
db4910bed4 Move all test related stuff in folder test 2019-06-05 11:45:02 +02:00