1061 Commits

Author SHA1 Message Date
Carl Osterwisch
bec75ed18a
fix: correctly parse (lbf in) (#3476) 2025-05-21 15:12:52 +02:00
David Contreras
920d0ca63c
feat: improve the performance of subset (#3467) 2025-05-21 10:09:30 +02:00
David Contreras
f9cb08d77e
feat: define embedded docs for compile, evaluate, parse, and parser, and add test for the examples in embedded docs (#3413) 2025-04-25 17:12:25 +02:00
Jos de Jong
c3ee5ba397
fix: Use matching type for one when operating with valueless unit and a number (#3454)
Previously, when a valueless unit multiplied/divided something with a numerical value, it would just use ordinary 1 of type `number` in place of its null value. Now it matches the type of one used with the other numerical value.

Resolves #3450.
---------
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
2025-04-16 12:56:57 -07:00
Jos de Jong
4e88b3bb0a chore: fix indentation 2025-04-16 09:03:32 +02:00
David Contreras
8b459f1e30
feat: increase performance of the map and forEach methods of DenseMatrix (#3446) 2025-04-09 11:55:36 +02:00
Jos de Jong
4a25655dfb chore: publish v14.4.0 2025-03-28 14:14:02 +01:00
Orel Ben Neriah
9a82b5c28e
feat: add LaTeX representation for fractions and corresponding tests (#3434) 2025-03-28 13:59:09 +01:00
David Contreras
2f62fdacfc
Merge branch 'develop' into deepMap-perforance-fix-3 2025-03-27 07:44:30 -06:00
aitee
b5773df3c0
fix: nthRoots latexFunctions template string (#3427) 2025-03-26 19:00:52 +01:00
David Contreras
459ea62230
Merge branch 'develop' into deepMap-perforance-fix-3 2025-03-21 10:20:48 -06:00
Jos de Jong
e5bb6465a9
fix: #3422 parse dot operators after an implicit multiplication with symbol E (#3425) 2025-03-19 09:23:09 -07:00
David Contreras
bd5799cafd
Merge branch 'develop' into deepMap-perforance-fix-3 2025-03-18 09:56:16 -06:00
David Contreras
5186a3dcca
feat: improve the performance of function flatten (#3400) 2025-03-12 18:49:16 +01:00
David Contreras
3c48eebde9 Add comments and simplify the code with regular expressions. 2025-03-07 19:47:23 -06:00
David Contreras
3700e9b057 Returned the use of maxDepth as it was slower to check for an array. 2025-03-06 23:38:55 -06:00
David Contreras
cc03d30fde Changed algorithm to avoid the use of maxDepth 2025-03-06 21:53:09 -06:00
Jos de Jong
acf3fd3f97 chore: publish v14.3.1 2025-03-06 12:33:00 +01:00
David Contreras
137b0c7005 Refactor to extend ._forEach instead of making a new method. 2025-03-04 21:34:20 -06:00
David Contreras
7c154a0e62 feat: return arity and use it for faster alrogithms 2025-03-01 23:43:37 -06:00
David Contreras
637fe39f83 feat: add unary support to map and forEach methods in DenseMatrix 2025-02-28 22:25:11 -06:00
Jos de Jong
3a49cf2e3c fix: broken integration test (see #3350) 2025-02-28 20:03:43 +01:00
Jos de Jong
1fc742aaf1 fix: #3350 cannot import a constant that is a complex number 2025-02-28 16:28:04 +01:00
Jos de Jong
17f295cd4f chore: publish v14.3.0 2025-02-28 15:44:35 +01:00
Jos de Jong
b8cf48696f chore: do not shadow isNaN (see #3389) 2025-02-28 15:42:51 +01:00
Jos de Jong
a104c7f136 chore: do not shadow isNaN (see #3389) 2025-02-28 15:42:42 +01:00
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
David Contreras
cf4e4192b0
feat: improved performance of functions map and forEach (#3399)
* Improve performance in iteration functions

* Included faster algorithms in collection

* Changed array methods to for

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-02-27 13:28:20 +01:00
David Contreras
8e528f9117
chore: refactor and simplify DenseMatrix._forEach (#3403)
* refactor: refactor _forEach method in DenseMatrix for readabilty without affecting performance

* Handle edge case

* Format

* Remove unnecesary skip

* Returned a fast case for flat arrays.
2025-02-27 12:04:17 +01:00
David Contreras
307c9dbca7
fix: issue in callback optimization and add error handling for invalid argument types (#3394)
Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-02-20 14:16:01 +01:00
David Contreras
d9b609b8fc
feat: improved performance of DenseMatrix Symbol.iterator (#3395) 2025-02-20 11:46:07 +01:00
David Contreras
40c09c5e76
refactor: simplify flatten function using Array.prototype.flat (#3354)
* refactor: simplify flatten function using Array.prototype.flat

* Added fallback

* added option to flatten arrays with homogeneous size

* Typos in array.js and array.test.js

* fix types in jsdocs

* Renamed variable

* Reverted to original form

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-02-17 17:19:13 +01:00
Glen Whitney
4c473eb5d1
chore: fix typo in mapSlices example (#3392)
Trivial change, merging myself
2025-02-15 09:11:02 -08:00
Jos de Jong
ad363507f3 chore: publish v14.2.1 2025-02-05 17:33:02 +01:00
Jos de Jong
3be5a74d63 chore: publish v14.2.0 2025-01-30 13:49:04 +01:00
Glen Whitney
127ea626fc
feat: #3041, #3340 rename apply to mapSlices (#3357)
* chore: Rename `apply` to `mapSlices`

  This renaming conforms with the Julia name for the function formerly
  called `apply`, and allows it to be called from the expression parser.
  The previous name `apply` is kept as an alias for `mapSlices`, for
  backward compatibility. This commit implements an `alias` metadata
  property for function factories to facilitate the `apply` alias for
  `mapSlices`.

  As a separate bonus, this PR corrects several typos in function docs
  and removes now-passing doc tests from the list of "known failing" doc
  tests to get down to 45 known failures and 136 total issues in doc tests.
  (Most of the excess of 136 as compared to 45 are just due to roundoff
  error/slight inaccuracy of what the documentation claims the result will
  be and the actual result returned by mathjs. When the 45 are eliminated,
  a reasonable numeric tolerance can be decided on for doc testing and
  then the doc tests can be made binding rather than advisory.

* refactor: changes per PR review

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-01-30 13:19:23 +01:00
Glen Whitney
1a85b8796a
fix: #3360 add bigint support to matrix indices and ranges (#3361)
* fix: Accept bigints as matrix indices and range params, demoting to number

* feat: bigint support in range(), clarify demotion in Range()

* feat: range() support Fraction, better errors for single non-string argument

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-01-30 13:07:24 +01:00
Glen Whitney
773a5c5cff
fix: #3247 don't override type-native floor/ceil within tolerance of value (#3369)
* fix: Don't override type-native floor/ceil when within tolerance of value

* refactor: extend bigint safety to round and fix

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2025-01-30 12:55:44 +01:00
Glen Whitney
b56fbcb13e
fix: type definitions for matrixFrom* (#3371)
* Addressed silentmissile's comment in https://github.com/josdejong/mathjs/issues/3125

* Added method overload to index.d.ts, have to revert commit due to changes to package-lock.json with using npm install to run the unit tests & lint tests

* Type definition missing for matrixFrom* #3115

* fix: Update types and add tests as requested by review

* chore: lint fix

---------

Co-authored-by: Hudsxn <jhudson98new@gmail.com>
Co-authored-by: Hudsxn <143907857+Hudsxn@users.noreply.github.com>
2025-01-29 16:34:50 +01:00
Jos de Jong
393cc66488 chore: publish v14.1.0 2025-01-24 11:44:22 +01:00
Jos de Jong
7ca0e6bf13 chore: fix a JSDoc example not always working depending on your timezone 2025-01-24 11:12:29 +01:00
Jos de Jong
0b2887be64 chore: cleanup unused function isIntegerStr and const DBL_EPSILON 2025-01-24 11:04:14 +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
b5d635e5b8
fix: #3342 hexadecimal input not turned into a bigint (#3348) 2025-01-24 10:40:01 +01:00
Jos de Jong
29abd1701b chore: 2024 to 2025 2025-01-06 09:31:00 +01:00
witer33
0443af52ac
docs: fixed description of sign in the embedded docs (#3338) 2024-12-18 17:58:30 +01:00
Jos de Jong
c095321f7e chore: publish v14.0.1 2024-12-11 18:05:00 +01:00
Paul Korzhyk
e0d56d2da7
fix: make derivative much faster (#3322) 2024-11-28 13:37:42 +01:00
Jos de Jong
45c9563e78 chore: publish v14.0.0 2024-11-20 12:43:05 +01:00
Jos de Jong
650830b8b8 Merge branch 'develop' into v14 2024-11-20 12:17:42 +01:00