mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
1,180 lines (922 loc) • 129 kB
Markdown
# History
# 2025-05-21, 14.5.0
- Feat: improve the performance of the `map` and `forEach` methods of
`DenseMatrix` (#3446). Thanks @dvd101x.
- Feat: improve the performance of `subset` (#3467). Thanks @dvd101x.
- Feat: define embedded docs for `compile`, `evaluate`, `parse`, and `parser`,
and add tests for the examples in embedded docs (#3413). Thanks @dvd101x.
- Fix: #3450 support multiplication of valueless units by arbitrary types
(#3454).
- Fix: #3474 correctly parse `(lbf in)` (#3476). Thanks @costerwi.
# 2025-03-28, 14.4.0
- Feat: improve the performance of function `flatten` (#3400). Thanks @dvd101x.
- Feat: improve the performance of `map` and `forEach` (#3409).
Thanks @dvd101x.
- Feat: add LaTeX representation for fractions (#3434, #3419). Thanks @orelbn.
- Fix: #3422 allow dot operators after symbol E (#3425).
- Fix: issue in the `nthRoots` latex function template string (#3427).
Thanks @aitee.
- Fix: upgrade to the latest version of `@babel/runtime`.
# 2025-03-06, 14.3.1
- Fix: #3350 cannot import a constant that is a complex number.
# 2025-02-28, 14.3.0
- Feat: improved performance of function `flatten` (#3354). Thanks @dvd101x.
- Feat: improved performance of `DenseMatrix` Symbol.iterator (#3395).
Thanks @dvd101x.
- Feat: improved performance of functions `map` and `forEach` (#3399).
Thanks @dvd101x.
- Fix: #3390 issue in callback optimization and add error handling for invalid
argument types (#3394). Thanks @dvd101x.
- Fix: #3356 add missing eigsDependencies export to TypeScript definitions
(#3397). Thanks @porst17.
- Fix: #3406 infer the correct type for multi-dimensional arrays in function
`multiply` (#3408). Thanks @orelbn.
- Fix: #3387 use utility `math.isNaN` for consistent `max` and `min` results
(#3389). Thanks @orelbn.
# 2025-02-05, 14.2.1
- Fix: #3377 remove redundant dependency `@lambdatest/node-tunnel`.
# 2025-01-30, 14.2.0
- Feat: #3041, #3340 rename `apply` to `mapSlices` (#3357). Function
`apply` is still available but is now marked deprecated. Thanks @gwhitney.
- Fix: #3247 don't override type-native floor/ceil within tolerance of value
(#3369). Thanks @gwhitney.
- Fix: #3360 add bigint support to matrix indices and ranges (#3361).
Thanks @gwhitney.
- Fix: #3115 type definitions for matrixFrom* (#3371). Thanks @Hudsxn
and @gwhitney.
# 2025-01-24, 14.1.0
- Feat: implement `bigint` support in functions `log`, `log2`, `log10`,
`larger`, `smaller`, `max`, `min` (#3345). Thanks @gwhitney.
- Fix: #3342 hexadecimal input not turned into a `bigint` (#3348).
- Fix `randomInt()` not working (#3345).
- Docs: fixed description of `sign` in the embedded docs (#3338).
Thanks @witer33.
# 2024-12-11, 14.0.1
- Fix: make derivative much faster (#3322). Thanks @paulftw.
- Fix: #3317 export `Fraction` type from the `fraction.js` library instead of
using a custom interface (#3330). Thanks @fchu.
# 2024-11-20, 14.0.0
!!! BE CAREFUL: BREAKING CHANGES !!!
- Feat: Upgrade to `fraction.js@5`, using `bigint` under the hood (#3283).
- Feat: Implement support for `Unit` in functions `ceil`, `floor`, and `fix`.
Possible breaking changes in the type definitions of arrays and matrices
due to the introduction of generics (#3269). Thanks @orelbn.
- Feat: Implement support for `log(x: Fraction, base: Fraction)`.
- Fix: #3301 precedence of `%` (mod) being higher than `*` and `/` (#3311).
Thanks @nkumawat34.
- Fix: #3222 prevent `math.import(...)` from overriding units unless you
specify `{ override: true }` (#3225).
- Fix: #3219 let functions `dotDivide`, `dotPow`, `bitXor`, `xor`, `equal`,
`larger`, `largerEq`, `smaller`, `smallerEq`, and `unequal` return a sparse
matrix when the input is two sparse matrices (#3307). Thanks @Aakash-Rana.
- Fix: Improve type definitions of arrays (#3306). Thanks @orelbn.
# 2024-11-20, 13.2.3
- Fix: #3260 improve type definitions and documentation on the callback
indices of `map`, `filter`, and `forEach`.
- Fix: #3323 support functions in function `clone`.
- Docs: fix a broken link in the documentation (#3316).
Thanks @emmanuel-ferdman.
# 2024-11-13, 13.2.2
- Fix: #1455 implicit multiplication of a fraction with unit `in` is incorrect
(#3315). Thanks @nkumawat34.
# 2024-11-06, 13.2.1
- Update to the latest version of `complex.js`.
- Fix `Index.dimension(dim)` accepting non-numeric input.
- Fix: #3290 should validate variables names in method `Parser.set` (#3308).
Thanks @nkumawat34.
# 2024-10-02, 13.2.0
- Feat: improve performance of functions `map`, `filter` and `forEach` (#3256).
Thanks @dvd101x.
- Feat: improve performance of the methods `map()` and `forEach()`
of `DenseMatrix` (#3251). Thanks @Galm007.
- Fix: #3253 cannot use identifiers containing special characters in function
`derivative`.
- Fix: improve the type definitions of `ConstantNode` to support all data
types (#3257). Thanks @smith120bh.
- Fix: #3259 function `symbolicEqual` missing in the TypeScript definitions.
- Fix: #3246 function `leafCount` missing in the TypeScript definitions.
- Fix: #3267 implicit multiplication with a negative number and unit `in`.
- Docs: fix broken links on the Configuration page. Thanks @vassudanagunta.
- Docs: document the syntax of `map` and `forEach` in the expression parser
(#3272). Thanks @dvd101x.
# 2024-08-27, 13.1.1
- Fix security vulnerability in the CLI and web API allowing to call functions
`import`, `createUnit` and `reviver`, allowing to get access to the internal
math namespace and allowing arbitrary code execution. Thanks @StarlightPWN.
- Fix security vulnerability: when overwriting a `rawArgs` function with a
non-`rawArgs` function, it was still called with raw arguments. This was both
a functional issue and a security issue. Thanks @StarlightPWN.
- Fix security vulnerability: ensure that `ObjectWrappingMap` cannot delete
unsafe properties. Thanks @StarlightPWN.
- Fix: not being able to use methods and properties on arrays inside the
expression parser.
# 2024-08-26, 13.1.0
- Feat: support multiple inputs in function `map` (#3228, #3196).
Thanks @dvd101x.
- Feat: add matrix datatypes in more cases (#3235). Thanks @dvd101x.
- Feat: export util functions `isMap`, `isPartitionedMap`, and
`isObjectWrappingMap`.
- Fix: #3241 function `map` not always working with matrices (#3242).
Thanks @dvd101x.
- Fix: #3244 fix broken link to `ResultSet` in the docs about classes.
- Docs: add a link to the documentation page about the syntax expression
from the function `evaluate` (see #3238).
- Docs: improve the documentation of `scope` and fix the example
`custom_scope_objects.js` (#3150)
- Docs: spelling fixes in the embedded docs (#3252). Thanks @dvd101x.
# 2024-07-19, 13.0.3
- Fix: #3232 fix type definitions of function `format` to support notations
`hex`, `bin`, and `oct`.
- Fix: use more precise definitions for US liquid volume units (#3229).
Thanks @Vistinum.
- Fix: #2286 types static methods and members for Unit class (#3230).
Thanks @orelbn.
# 2024-07-04, 13.0.2
- Fix an error in the type definitions of `quantileSeq` (#3223).
Thanks @domdomegg.
# 2024-06-28, 13.0.1
- Fix: #3227 generated bundle containing `catch` blocks without parameters.
- Fix: #2348 update type definitions of the `Parser` methods (#3226).
Thanks @orelbn.
# 2024-05-31, 13.0.0
Breaking changes:
- Change `isZero`, `isPositive`, and `isNegative` to respect `config.epsilon`
(#3139, #2838). Thanks @dvd101x.
- Change the behavior of the internal `nearlyEqual` to align with Python and
Julia (#3152, #2838). Thanks @dvd101x.
- Upgrade to `fraction.js@4.3.7`,
see <https://github.com/rawify/Fraction.js/issues/68>.
- Dropped support for JavaScript engines that do not fully support ES6 or
`bigint`, or are not actively maintained. ES2020 is now the minimum required
EcmaScript version.
Non-breaking changes:
- Implemented support for `bigint` (#3207, #3207)
- Implemented a new config option `config.numberFallback` needed for `bigint`
(#3207).
- Internal: refactored tooling to ES modules and upgraded all devDependencies.
# 2024-05-31, 12.4.3
- Fix: serialization of Units without a value, see #1240.
- Fix: outdated, incorrect documentation about the order of precedence for
operator modulus `%`. See #3189.
- Fix: #3197 improve `quantileSeq` type definitions (#3198). Thanks @domdomegg.
# 2024-04-24, 12.4.2
- Fix #3192: function `isNaN` returns `false` for `NaN` units in a matrix or
array (#3193). Thanks @lgerin.
- Fix: #3180 fix type definitions of functions `add` and `multiply` to allow
more than two arguments.
- Docs: correct the docs about `traverse` returning void (#3177).
Thanks @rohildshah.
# 2024-03-13, 12.4.1
- Docs: implement an interactive version of the Lorenz example, and show the
chart full screen (#3151). Thanks @dvd101x.
- Fix #3172: simplify `"true and true"`.
- Fix #3163: `toTex` wrongly returning `Infinity` for large BigNumbers.
- Fix #3162: add license information about CSParse (#3164).
- Fix #3175: cannot delete units using `math.Unit.deleteUnit`.
- Fix: faster startup time of the CLI and REPL by loading the bundle.
- Fix: remove using polyfill.io inside the example
`pretty_printing_with_mathjax.html` (#3167). Thanks @SukkaW.
# 2024-02-22, 12.4.0
- Feat: implement support for trailing commas in matrices (#3154, #2968).
Thanks @dvd101x.
- Feat: improve the performance of `multiply` a lot by adding matrix type
inferencing (#3149). Thanks @RandomGamingDev.
- Fix: #3100 function `round` not handling round-off errors (#3136).
Thanks @BrianFugate.
- Fix: `PartitionedMap` and `ObjectWrappingMap` missing a property
`Symbol.iterator`, causing problems when trying `new Map(scope)` (#3156).
- Fix: type definitions of function `mode` (#3153). Thanks @rich-martinez.
- Docs: describe method `getAllAsMap` in the Parser docs (#3158, #3157).
Thanks @dvd101x.
# 2024-02-08, 12.3.2
- Improved the performance of custom defined functions in the expression
parser (#3150).
- Fix: #3143 cannot use `and` and `or` inside a function definition.
Regression since `v12.1.0` (#3150).
# 2024-02-01, 12.3.1
- Improved the typings of the arguments of `ArrayNode`, `FunctionNode`,
`IndexNode`, `OperatorNode`, and `RelationalNode` (#3123). Thanks @sylee957.
- Added a fully featured code editor example with CodeMirror and Katex (#3027).
Thanks @dvd101x.
- Fix: #3114 build warnings related to a number of wrong `/* #__PURE__ */`
annotations.
- Fix: #3142 support BigNumber values for the options of function `format`:
`precision`, `wordSize`, `lowerExp`, `upperExp`. Support BigNumber values
for the option `wordSize` in the functions `hex`, `bin`, and `oct`.
- Fix: #3125 type definitions of function `hypot` (#3144).
Thanks @silentmissile.
- Fix: #3141 `help(config)` altering the actual `config` when evaluating the
examples.
- Docs: #3145 fix documentation about REPL, it does require a build step
nowadays.
# 2024-01-12, 12.3.0
- Implement support new metric prefixes: `ronna` (`R`), `quetta` (`Q`),
`ronto` (`r`), and `quecto` (`q`) (#3113, #3112). Thanks @AlexEdgcomb.
- Fix a bug converting a unitless unit (#3117). Thanks @costerwi.
- Fix: #3097 `toSI()` wrongly converting `degC` (#3118). Thanks @costerwi.
# 2023-12-20, 12.2.1
- Fix #3109: method `Node.toHTML` not accepting a custom `handler`.
# 2023-12-08, 12.2.0
- Feat: lazy evaluation of operators `and`, `or`, `&`, `|` (#3090, #3101,
#2766). Thanks @smith120bh.
- Fix: passing a 4th argument with a scope to raw functions.
- Fix: #3096 embedded docs of eigs throwing an error.
# 2023-11-17, 12.1.0
- Feat: Extend function `round` with support for units (#2761, #3095).
- Feat: Extend function `mod` with support for negative divisors in when
using `BigNumber` or `Fraction` (#3087).
- Fix: #3092 a typo in an error message when converting a string into a number.
- Fix: #3094 function `derivative` mutates the input expression when it fails.
# 2023-10-26, 12.0.0
Breaking changes:
- Fix #2879, #2927, #3014: change the confusing interface of `eigs` (#3037),
thanks @gwhitney.
Before, functions `eigs` returned an object:
```
{ values: MathCollection; vectors: MathCollection }
```
where `vectors` was a 2d matrix of which the columns contained the vectors.
This is changed to `eigs` returning an object:
```
{
values: MathCollection
eigenvectors: Array<{
value: number | BigNumber
vector: MathCollection
}>
}
```
Where `eigenvectors` is an array containing an object with the corresponding
eigenvalue and vector.
- Refactored the TypeScript type definitions to make them work with a `NodeNext`
module resolution (#3079, #2919).
- Type `MathJsStatic` is renamed to `MathJsInstance`.
- Type `FactoryDependencies` is deprecated, use `MathJsFactory` instead, and
import dependency maps directly from the library.
- Change the assignment operator of `.toTex()` output from `:=` to `=` (see
#2980, #2987).
- Drop official support for Node.js 14 and 16.
Features:
- Function `eigs` now has an option to turn off calculation of eigenvectors
(#3057, #2180). Thanks @gwhitney.
Fixes:
- Find eigenvectors of defective matrices (#3037). Thanks @gwhitney.
# 2023-10-26, 11.12.0
- Implemented function `subtractScalar` (#3081, #2643), thanks @vrushaket.
- Fix #3073: function format not escaping control characters and double
quotes (#3082).
- Fix: function `clone` not throwing an error when passing an unsupported
type like a function.
- Fix: #2960 add type definition of function `symbolicEqual` (#3035),
thanks @juancodeaudio.
# 2023-10-11, 11.11.2
- Fix #3025: improve handling of matrices and error handling
in function `corr` (#3030). Thanks @vrushaket.
- Fix #3074: improve error message when using function `max` in `derivative`.
- Fix #3073: fix parsing quotes inside a string.
- Fix #2027: cannot use named operators like `to` or `mod` as property name.
# 2023-09-20, 11.11.1
- Fix #2989: use one-based indices in `print` in the parser (#3009).
Thanks @dvd101x.
- Fix #2936: `mod` sometimes giving wrong results due to internal round-off
errors (#3011). Thanks @praisennamonu1.
- Internal refactor of `quantileSeq`, and fixed the embedded help (#3003).
Thanks @dvd101x.
- Updated dependencies and devDependencies.
# 2023-09-05, 11.11.0
- Implement function `corr` to calculate the correlation between two matrices
(#3015, #2624). Thanks @vrushaket.
- Lock `fraction.js` at version `4.3.4` for now, see #3024, 3022,
<https://github.com/rawify/Fraction.js/issues/68>.
# 2023-08-31, 11.10.1
- Upgrade to `fraction.js@4.3.4`, see #3022.
- Fix #3020: `lruQueue` using the global `hasOwnProperty` which may be
polluted.
- Add support for prefixes for the unit `erg`, and restrict prefixes of the
unit `joule` to only long prefixes like `kilo` and no short prefixes
like `k` (#3019). Thanks @costerwi.
- Add a new browser example `examples/browser/lorenz.html` that uses `solveODE`
and plots the result in a chart (#3018). Thanks @dvd101x.
# 2023-08-23, 11.10.0
- Extend function `quantileSeq` with support for a `dimension` (#3002).
Thanks @dvd101x.
- Implement #2735: Support indexing with an array of booleans, for
example `a[[true, false, true]]` and `a[a > 2]` (#2994). Thanks @dvd101x.
- Implement function `zeta` (#2950, #2975, #2904). Thanks @Bobingstern.
- Fix #2990: `DenseMatrix` can mutate input arrays (#2991).
# 2023-07-24, 11.9.1
- Fix a security vulnerability in `FunctionNode` and `SymbolNode` allowing
arbitrary code execution via `math.evaluate`. Thanks Harry Chen.
- Fix #3001: mathjs bundle containing `new Function(...)` (CSP issue).
# 2023-07-19, 11.9.0
- Implement function `solveODE` (#2958). Thanks @dvd101x.
- Implement functions `zpk2tf` and `freqz` (#2988, #2969). Thanks @alykhaled.
- Implement support for units in function `range` (#2997). Thanks @dvd101x.
- Fix #2974: `simplify` puts plus and minus signs next to each other (#2981).
Thanks @MaybePixem.
- Fix #2973: fixes and improvements in the embedded docs (#2976).
Thanks @dvd101x.
- Fix #2996: two errors in the examples in the documentation about Expression
trees.
- Fix round-off errors near zero when converting temperatures (#2962).
Thanks @costerwi.
- Refactored function `range`, reducing the amount of code (#2995).
Thanks @dvd101x.
# 2023-06-20, 11.8.2
- Fix #2971: improve typings of statistics functions `min`, `max`, `mean`,
`median`, `mode`, `std`, `sum`, `prod`, `variance`. Fixes a regression
introduced in v11.8.1.
- Fix #2972: type definitions of `Unit.divide(Unit)` have a wrong return type.
# 2023-06-13, 11.8.1
- Fix #2964: issue in function `distance` when calculate the distance from
a point to a line (#2965). Thanks @Kiku-CN.
- Fix `math.format` not working correctly for `engineering` notation when using
BigNumbers and for `fixed` notation with `precision: 0` configured (#2956).
Thanks @mgreminger.
- Fix #2880: not possible to map cube root `cbrt`.
- Fix #2938: make the syntax description of all functions consistent in the
docs (#2941). Thanks @dvd101x.
- Fix #2954: improve the TypeScript definitions the return type of functions
`min` and `max` (#2955). Thanks @Maxim-Mazurok.
- Fix #2959: typo in an example in the docs. Thanks @kunalagrwl.
- Drop official support for Node.js 14, has reached end of life.
# 2023-04-03, 11.8.0
- Extended functions `fraction`, `bignumber`, and `number` with support for
units, see #2918 (#2926).
- Implemented aliases `amp` and `amps` for unit `ampere` (#2917).
Thanks @veggiesaurus.
- Improve TypeScript definitions of function `gcd` (#2922). Thanks @brunoSnoww.
- Fix #2923: improve docs of the function `distance` (#2924). Thanks @tmtron.
# 2023-03-15, 11.7.0
- Implement #2567: accept array as parameter for function `gcd` (#2878).
Thanks @jakubriegel.
- Fix #2908: improvements in the docs and examples of functions
`partitionSelect`, `diff`, `expm1`, `round`, `nthRoots`, `sign`,
`rigthArithShift`, `setIsSubset`, `setSize`, and the docs about units.
Thanks @tmtron.
- Fix #2907: determinant of empty matrix should be 1.
- Refactor index.d.ts by writing function declarations using a generic,
reducing a lot of repetition (#2913). Thanks @brunoSnoww.
# 2023-02-24, 11.6.0
- Implement broadcasting for the following functions and their corresponding
operator: `add`, `dotDivide`, `dotMultiply`, `dotPow`, `gcd`, `lcm`, `mod`,
`nthRoot`, `subtract`, `bitAnd`, `bitOr`, `bitXor`, `leftShift`,
`rightArithShift`, `rightLogShift`, `and`, `or`, `xor`, `compare`,
`compareText`, `equal`, `larger`, `largerEq`, `smaller`, `smallerEq`,
`unequal`, `atan2` and `to` (#2895, #2753). Thanks @dvd101x.
- Implement support for non-power-of-2 fft (#2900, #2577). Thanks @cyavictor88.
- Fix #2888: update type definitions of function `unit` to allow creating a
unit from a fraction or complex number.
- Fix #2892: an error in the examples of the embedded help of function `sort`.
- Fix #2891: functions `column` and `row` sometimes returning a scalar number.
- Fix #2896: define the fourth argument of function `intersect` as optional
in the TypeScript definitions. Thanks @wodndb.
- Fix: quantileSeq not accepting a matrix as second argument `prob` (see #2902).
- Fix broken examples in functions `to`, `distance`, `getMatrixDataType`,
`subset`, and `max` (see #2902).
# 2023-01-31, 11.5.1
- Add type definitions for function `rotationMatrix` (#2860).
Thanks @brunoSnoww.
- Add type signature for `lusolve(LUDecomposition, ...)` (#2864).
Thanks @evanmiller.
- Fix #2873: the rocket_trajectory_optimization.html example being partly
broken. Thanks @dvd101x.
- Fix #2871: coverage report broken (#2877). Thanks @bornova.
- Fix #2883: update documentation for stat functions, describe missing syntax.
- Fix #2884: fix examples in the embedded docs of function `pow` and some other
functions.
- Fix type definition of function `complex` for one numeric input (#2886),
thanks @ariymarkowitz.
- Fix type definitions of `map()` and `forEach()` (#2887), thanks @xiaohk.
- Fix #2606: improve type definitions of `dotMultiply`, `dotPow` and
`dotDivide` (#2890). Thanks @brunoSnoww.
# 2022-12-05, 11.5.0
- Improve `simplify` rule matches in non-commutative contexts (#2841).
Thanks @samueltlg.
- Simplify: add rules and restructure tests for non-commutative contexts
(#2847). Thanks @samueltlg.
- Fix function `reshape` mutating the input in case of a matrix (see #2854).
- Fix TypeScript types for `multiply()` with `number[]` and `number[][]`
(#2852). Thanks @hfhchan.
# 2022-11-18, 11.4.0
- Implemented more wildcards to describe rules for `simplify`, making it easier
for example to describe unary minus (#1915). Thanks @thatcomputerguy0101.
- Implemented functions `schur`, `sylvester`, and `lyap` (#2646).
Thanks @egidioln.
- Implemented function `polynomialRoot`, and use it in a benchmark (#2839).
Thanks @gwhitney.
- Fix #2825 partly: improve simplifying operations on constants in
non-commutative contexts (#2827). Thanks @samueltlg.
- Fix #2840: a bug in the docs and type definitions of `Node.traverse` and
`Node.forEach`, they do return `void`.
# 2022-11-07, 11.3.3
- Fix #2830: Prevent inserting zero values when creating a `SparseMatrix` from a
`DenseMatrix` (#2836). Thanks @AlexandreAlvesDB.
- Fix #2835: a regression in the type definitions of `FunctionNode`, introduced
in `v11.3.2`. See #2733. Thanks @dsteve.
# 2022-10-25, 11.3.2
- Add generics to remaining Node type definitions (#2733). Thanks @mattvague.
- Allow unit prefixes for (absolute) temperatures `kelvin`, `rankine`,
`celsius`, and `fahrenheit` (#2824). Thanks @jfeist
# 2022-10-19, 11.3.1
- Fix #2809: code completion issues in some IDE's (#2812).
- Fix #2818: throw an error when a function assignment has duplicate
parameter names (#2819).
- Update `decimal.js` to version `10.4.2`.
# 2022-10-11, 11.3.0
- Allow creating new subclasses of `Node` in TypeScript (#2772).
Note that this disables being able to narrow MathNodes by using the `.type`
property. Use typeguards like `isOperatorNode(...)` instead (see #2810).
Thanks @mattvague.
- Fix #2793: `flatten()` cloning entries of array/Matrix (#2799).
- Fix #2627: TypeScript definitions of `pinv` missing (#2804).
Thanks @HanchaiN.
- Update dependencies to `decimal.js@10.4.1`.
# 2022-09-13, 11.2.1
- Fix doc generator being broken, not generating a function reference.
# 2022-09-12, 11.2.0
- Implement function `isRelationalNode` (#2731). Thanks @isaacbyr.
- Added missing types `'largerEq'` and `'or'` in `OperatorNodeMap` in the
TypeScript definitions. Thanks @ajinkyac03.
- Fixed typos in min func type defs (#2768). Thanks @mabdullahadeel.
- Improved the TypeScript definitions for `pickRandom`. Thanks @mattvague.
- Fixed documentation of unit `min` which means `minutes`, not `minim` (#2773).
Thanks @jasonhornsby.
# 2022-08-23, 11.1.0
- Add Unit constructor from value and pure (valueless) Unit (#2628).
Thanks @costerwi
- Fix #2144: `examples/advanced/custom_loading.js` was broken.
- Fix JSON `replacer` function missing in the TypeScript definitions.
Thanks @mattvague.
- Update dependencies to `typed-function@4.1.0` and `decimal.js@10.4.0`.
# 2022-07-25, version 11.0.1
- Fix #2632: TypeScript issue of `simplifyConstant` and `simplifyCore`
not having a return type defined.
# 2022-07-23, version 11.0.0
!!! BE CAREFUL: BREAKING CHANGES !!!
Breaking changes:
- Dropped official support for IE11.
- Upgraded to `typed-function@3`, see [josdejong/typed-function/HISTORY.md](https://github.com/josdejong/typed-function/blob/develop/HISTORY.md#2022-05-12-version-300). Thanks @gwhitney. Most importantly:
- Conversions now have preference over `any`.
- The `this` variable is no longer bound to the typed function itself.
- The properties `typed.types`, `typed.conversions`, and `typed.ignore`
have been removed.
- There are new static functions available like `typed.referTo`,
`typed.referToSelf`, `typed.addTypes`, `typed.addConversions`.
- Implement amended "Rule 2" for implicit multiplication (#2370, #2460):
when having a division followed by an implicit multiplication, the division
gets higher precedence over the implicit multiplication when (a) the
numerator is a constant with optionally a prefix operator (`-`, `+`, `~`),
and (b) the denominator is a constant. For example: formerly `-1 / 2 x` was
interpreted as `-1 / (2 * x)` and now it is interpreted as `(-1 / 2) * x`.
Thanks @gwhitney.
- Drop elementwise matrix support for trigonometric functions, exp, log, gamma,
square, sqrt, cube, and cbrt to prevent confusion with standard matrix
functions (#2440, #2465). Instead, use `math.map(matrix, fn)`.
Thanks @gwhitney.
- Simplify: convert equivalent function calls into operators, for example,
`add(2, x)` will now be simplified into `2 + x` (#2415, #2466).
Thanks @gwhitney.
- Removed the automatic conversion from `number` to `string` (#2482).
Thanks @gwhitney.
- Fix #2412: let function `diff` return an empty matrix when the input contains
only one element (#2422).
- Internal refactoring in the `simplifyCore` logic (#2490, #2484, #2459).
The function `simplifyCore` will no longer (partially) merge constants, that
behavior has been moved to `simplifyConstant`. The combination of
`simplifyConstant` and `simplifyCore` is still close to the old behavior
of `simplifyCore`, but there are some differences. To reproduce the same
behavior as the old `simplifyCore`, you can use
`math.simplify(expr, [math.simplifyCore, math.simplifyConstant])`.
Thanks to the refactoring, `simplify` is more thorough in reducing constants.
Thanks @gwhitney.
- Disable support for splitting rest parameters in chained calculations
(#2485, #2474). For example: `math.chain(3).max(4, 2).done()` will now throw
an error rather than return `4`, because the rest parameter of
`math.max(...number)` has been split between the contents of the chain and
the arguments to the max call. Thanks @gwhitney.
- Function `typeOf` now returns `function` (lowercase) for a function instead
of `Function` (#2560). Thanks @gwhitney.
Non-breaking changes:
- Fix #2600: improve the TypeScript definitions of `simplify`.
Thanks @laureen-m and @mattvague.
- Fix #2607: improve type definition of `createUnit`. Thanks @egziko.
- Fix #2608: clarify the docs on the need to configure a smaller `epsilon`
when using BigNumbers.
- Fix #2613: describe matrix methods `get` and `set` in the docs.
- Fix link to `math.rationalize` in the docs (#2616). Thanks @nukisman.
- Fix #2621: add TypeScript definitions for `count` (#2622). Thanks @Hansuku.
- Improved TypeScript definitions of `multiply` (#2623). Thanks @Windrill.
# 2022-06-28, version 10.6.4
- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
# 2022-06-24, version 10.6.3
- Revert the TypeScript definition fixes for `factory` applied in `v10.6.2`,
they give some complications.
# 2022-06-24, version 10.6.2
- Improve TypeScript definitions of `ParenthesisNode`. Thanks @mattvague.
- Change the TypeScript definition of `MathNodeCommon['type']` into a less
strict string, so it is possible to extend with new Node classes.
Thanks @mattvague.
- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
# 2022-05-31, version 10.6.1
- Improve the TypeScript types For `OperatorNode`: you can now define generic
types like `OperatorNode<'+', 'add'>`. Thanks @mattvague.
# 2022-05-24, version 10.6.0
- Implementation of Fourier transform functions `fft` and `ifft` (#2540).
Thanks @HanchaiN.
- Fix TypeScript types not being listed in the exported fields (#2569).
Thanks @mattvague.
- Large improvements in TypeScript definitions for chained expressions (#2537).
Thanks @mattvague.
- Fix #2571: improve TypeScript definition of functions `clone` and `cloneDeep`
(#2572). Thanks @mattvague.
- Fix the first argument of `derivative` holding the expression not correctly
being converted when using `.toTex()` (#2564). Thanks @mattvague.
# 2022-05-11, version 10.5.3
- Fix #2337: npm package containing examples and docs to solve security
vulnerabilities being reported on the examples and their dependencies.
- Fix core, construction, and some other functions missing in docs.
- Drop official support for Node.js 12 which has reached its end of life.
# 2022-05-09, version 10.5.2
- Fix #2553: `@types/mocha` defined in `dependencies` instead of
`devDependencies`, causing problems in projects that use a different version
of this dependency. Thanks @Kolahzary.
- Fix #2550: remove `examples/node_modules` folder from the npm package.
- Fix #2528: improve contribution guidelines (#2548).
- Document `SymbolNode.onUndefinedSymbol` and
`FunctionNode.onUndefinedFunction`.
# 2022-05-02, version 10.5.1
- Fix #2526, #2529: improve TypeScript definitions of function `round`, `fix`,
`floor`, `ceil`, and `nthRoot`, and improved the number only implementations
of those functions (#2531, #2539). Thanks @simlaticak and @gwhitney.
- Fix #2532: matrix index symbol `end` not working when used inside
a sub-expression.
- Fix #2524: In generating AUTHORS list, ignore a list of specific commits
(e.g., to avoid spurious duplicates in list). (#2543)
- Add type definitions of function `resolve` (#2536). Thanks @mattvague.
# 2022-04-19, version 10.5.0
- Implement #1563: function `pinv`, Moore–Penrose inverse (#2521).
Thanks @HanchaiN.
- Optimize function `det` for integers by switching to the Bareiss algorithm:
no more round-off errors for integer input (#2516). Thanks @HanchaiN.
- Implement #2463: allow negative integer powers of invertible square matrices
(#2517). Thanks @HanchaiN.
- Implement the `lgamma` function (defined as log(gamma(z))) for number and
Complex types. Supersedes #320. (#2417). Thanks @yifanwww.
- Fix #2523: update to the latest complex.js to improve `sin(z)` for small
`im(z)` (#2525). Thanks @gwhitney.
- Fix #2526: update TypeScript definition of `ceil` (#2531). Thanks @simlaticak
- Change mocha reporter to 'dot' to avoid excessively long log files. (#2520)
# 2022-04-08, version 10.4.3
- Fix #2508: improve the precision of stirlingS2 (#2509). Thanks @gwhitney.
- Fix #2514: implement optional argument `base` in the number implementation
of function `log` (#2515). Thanks @gwhitney.
- Improve the documentation on operator `;` (#2512). Thanks @gwhitney.
# 2022-03-29, version 10.4.2
- Fix #2499: different behavior for unit conversion "degC" and "K" (#2501).
Also disables getting the sign for units with an offset, which is ambiguous.
Thanks @gwhitney.
- Fix #2503: fix an issue in `log()` for complex numbers in which the imaginary
part is much larger in absolute value than the real part, fixed in
`complex.js@2.1.0` (#2505), thanks @gwhitney, @infusion.
- Fix #2493: unclear error message when an entity that is not a function
is being called as a function (#2494). Thanks @gwhitney.
- Some fixes in the docs on units (#2498). Thanks @dvd101x.
- Add `forEach` example in embedded docs (#2507). Thanks @dvd101x.
- Correct approx.deepEqual() to accept an epsilon argument giving the
comparison tolerance. It was already being called this way, but was
silently ignoring the tolerance. Thanks @yifanwww.
# 2022-03-23, version 10.4.1
- Improve TypeScript definitions for function `unit` (#2479).
Thanks @SinanAkkoyun.
- Add tests for type declarations (#2448). Thanks @samestep.
- Further improvement to TypeScript definitions of `std` and `variance`
(make dimension parameter optional, #2474). Thanks @NattapongSiri.
- Next step (as per #2431) for full publication of "is" functions like
`isMatrix` etc: Provide TypeScript definitions of "is" functions and
make them type guards. (#2432). Thanks @ChristopherChudzicki.
- Fix #2491: Multi line object expressions don't work with comments (#2492).
Thanks @gwhitney.
- Fix #2478: a bug in calculating the eigenvectors when dealing with complex
numbers (#2496). Thanks @gwhitney.
- Update project dependencies and devDependencies.
# 2022-03-07, version 10.4.0
- Fix #2461: make sure `simplifyCore` recurses over all binary nodes (#2462).
Thanks @gwhitney.
- Fix #2429: fix the TypeScript definitions of functions `std` and `variance`
(#2455). Thanks @NattapongSiri.
- Fix #1633: implement a `cumsum` function generating cumulative sums of a list
of values or a matrix. (#1870). Thanks @hjonasson.
- Upgrade to the latest version of `Fraction.js`, having more strict input,
only accepting an integer numerator and denominator. See #2427.
- Fix typo in documentation example for `format`. (#2468) Thanks @abranhe.
- Write unit tests for all jsdoc examples. See #2452. Thanks @gwhitney.
# 2021-03-02, version 10.3.0
- Fix #1260: implement function `symbolicEqual` (#2424). Thanks @gwhitney.
- Fix #2441, #2442: support passing a function as argument to functions created
in the expression parser (#2443). Thanks @gwhitney.
- Fix #2325: improve documentation of subset indices (#2446). Thanks @gwhitney.
- Fix #2439: fix a bug in `complexEigs` in which real-valued norms were
inadvertently being typed as complex numbers (#2445). Thanks @gwhitney.
- Fix #2436: improve documentation and error message of function `map` (#2457).
Thanks @gwhitney.
# 2022-03-01, version 10.2.0
- Implemented context options to control simplifications allowed in `simplify`,
see #2399, #2391. Thanks @gwhitney.
- Implemented function `leafCount` as a first simple measure of the complexity
of an expression, see #2411, #2389. Thanks @gwhitney.
- Fix #2413: improve `combinations` to return an integer result without rounding
errors for larger values, see #2414. Thanks @gwhitney.
- Fix #2385: function `rotate` missing in TypeScript definitions.
Thanks @DIVYA-19.
- Fix #2450: Add BigNumber to parameter type in `math.unit` and add TypeScript
types for `Unit.simplify` and `Unit.units` (#2353). Thanks @joshhansen.
- Fix #2383: detect infinite loops in `simplify` (#2405). Thanks @gwhitney.
- Fix #1423: collect like factors and cancel like terms in sums (#2388).
Thanks @gwhitney.
# 2022-02-02, version 10.1.1
- Improvements and fixes in function `simplify`, thanks @gwhitney:
- Fix #2393: regression bug in `simplify('2-(x+1)')`.
- Ad option `consoleDebug` to `simplify` to see what is going on.
- Fix TypeScript definition of `ConfigOptions`, which was missing option
`predictable`.
# 2022-01-15, version 10.1.0
- Implemented function `invmod`, see #2368, #1744. Thanks @thetazero.
- Improvements and fixes in function `simplify`, thanks @gwhitney:
- Fix #1179, #1290: improve collection of non-constant like terms (#2384).
- Fix #2152: do not transform strings into numbers (#2372).
- Fix #1913: implement support for array and object simplification (#2382).
- Fix #2379: add embedded documentation for function `print`.
- Remove broken example from the embedded documentation of function `forEach`.
# 2021-12-29, version 10.0.2
- Fix #2156: simplify expressions like `-1 / (-x)` to `1/x`. Thanks @ony3000.
- Fix #2363: remove a redundant part of the regex to split a number.
- Fix #2291: add support for fractions in function `intersect`.
Thanks @thetazero.
- Fix #2358: bug in `SparseMatrix` when replacing a subset of a matrix with
a non-consecutive index. Thanks @Al-0.
# 2021-12-22, version 10.0.1
- Fix #1681: function `gamma` giving inaccurate complex results in some cases.
Thanks @kmdrGroch.
- Fixed a typo in an example, see #2366. Thanks @blackwindforce.
# 2021-11-03, version 10.0.0
!!! BE CAREFUL: BREAKING CHANGES IN THE TYPESCRIPT DEFINITIONS !!!
- Improvements to the Typescript typings (commit fc5c202e).
Thanks @joshhansen. First introduced in v9.5.1, but reverted because
it contains breaking changes.
Breaking changes: interface `MathNode` is now renamed to `MathNodeCommon`
and the related interfaces are structured in a different way.
- Fixed a typo in the TypeScript definition of toHTML. Thanks @TheToto.
# 2021-11-03, version 9.5.2`
- Revert the improvements to the Typescript typings because they contain
breaking changes. The improvements will be published in v10.0.0. See #2339.
# 2021-10-13, version 9.5.1
- Various improvements to the Typescript typings.
Thanks @joshhansen and @DianaTdr.
# 2021-09-22, version 9.5.0
- Implemented support for calculations with percentage, see #2303.
Thanks @rvramesh.
- Fix #2319: make the API of `Parser.evaluate` consistent with `math.evaluate`:
support a list with expressions as input.
- Improved documentation of function `setCartesian`. Thanks @fieldfoxWim.
# 2021-09-15, version 9.4.5
- Improved the performance of `Node.equals` by improving the internal
function `deepStrictEqual`. Thanks @tomlarkworthy.
- Fixes in the TypeScript definitions:
- Define `hasNumericValue`. Thanks @write2kcl.
- Define `MathNode.isRelationalNode`. Thanks @m93a.
- Fix typo in `MathNode.isConditionalNode`. Thanks @m93a.
# 2021-07-07, version 9.4.4
- Fixed `ArrayNode.toTex()`: remove the row delimiter on the last row,
see #2267. Thanks @davidtranhq.
- Fix #2269: `intersect` not returning `null` for matrix input. Thanks @m93a.
- Fix #2245: mathjs not working in IE11 anymore due to a missing polyfill for
`Symbol`. The browser bundle now includes the necessary polyfills (it is
larger now because of that, see also #2266). Thanks @m93a.
- Update dependencies (`complex.js@2.0.15`, `decimal.js@10.3.1`)
- Drop official support for node.js 10, which has reached end of life.
See #2258.
# 2021-06-23, version 9.4.3
- Fix #2222: mathjs polluting the `Decimal` prototype. Thanks @m93a.
- Fix #2253: expression parser throwing an error when accessing nested object
properties named `e`.
- Fixes in the TypeScript definitions:
- function `floor`, #2159, #2246. Thanks @write2kcl.
- function `simplify`, see #2252. Thanks @nitroin.
- Upgraded to `decimal.js@10.3.0`
# 2021-06-05, version 9.4.2
- Implemented iterative eigenvalue finder for `eigs`, making it much more
robust. See #2179, #2237. Thanks @m93a.
- Improved TypeScript definitions of function `parse`. Thanks @OpportunityLiu.
# 2021-05-24, version 9.4.1
- Fix #2100: add TypeScript declaration for `eigs`. Thanks @andrebianchessi.
- Fix #2220: add TypeScript files to published npm package. Thanks @dhritzkiv.
- Update readme regarding TypeScript definition files. Thanks @dhritzkiv.
- Update to `fraction.js@4.1.1`
# 2021-05-16, version 9.4.0
- Implemented support to use objects with a `Map` interface as scope,
see #2143, #2166. Thanks @jhugman.
- Extend `eigs` to support general complex matrices, see #1741. Thanks @m93a.
- DenseMatrix and SparseMatrix are now iterable, see #1184. Thanks @m93a.
- Implemented utility functions `matrixFromRows`, `matrixFromColumns`, and
`matrixFromFunction`, see #2155, #2153. Thanks @m93a.
- Added TypeScript definitions to the project, making it redundant to install
`@types/mathjs`, and making it easier to improve the definitions. See #2187,
#2192. Thanks @CatsMiaow.
- Upgraded dependencies
- `complex.js@2.0.13` (fixing #2211). Thanks @infusion
- `fraction.js@4.1.0` (`pow` now supporting rational exponents).
- Fix #2174: function `pickRandom` having no name. Thanks @HK-SHAO.
- Fix #2019: VSCode auto import keeps adding import { null } from 'mathjs'.
- Fix #2185: Fix TypeScript definition of unit division, which can also return
a number.
- Fix #2123: add type definitions for functions `row` and `column`.
- Fix some files not exposed in the package, see #2213. Thanks @javiermarinros.
# 2021-04-12, version 9.3.2
- Fix #2169: mathjs requesting `@babel/runtime` dependency.
Regression introduced in `v9.3.1`.
# 2021-04-10, version 9.3.1
- Fix #2133: strongly improved the performance of `isPrime`, see #2139.
Thanks @Yaffle.
- Fix #2150: give a clear error "Error: Undefined function ..." instead when
evaluating a non-existing function.
- Fix #660: expose internal functions `FunctionNode.onUndefinedFunction(name)`
and `SymbolNode.onUndefinedSymbol(name)`, allowing to override the behavior.
By default, an Error is thrown.
# 2021-03-10, version 9.3.0
- Implemented support for parsing non decimal numbers with radix point,
see #2122, #2121. Thanks @clnhlzmn.
- Fix #2128: typo in docs of `luSolveAll` and `usolveAll`.
# 2021-02-03, version 9.2.0
- Implemented function `count` to count the total elements in a matrix,
see #2085. Thanks @Josef37.
- Fix #2096: cleanup old reference to external dependency `crypto`.
- Some refactoring in the code to remove duplications, see #2093.
Thanks @Josef37.
# 2021-01-27, version 9.1.0
- Extended function `reshape` with support for a wildcard `-1` to automatically
calculate the remaining size, like `reshape([1, 2, 3, 4, 5, 6], [-1, 2])`
which will output `[[0, 1], [2, 3], [4, 5]]`. See #2075. Thanks @Josef37.
- Fix #2087: function `simplify` ignores second argument of `log`, for example
in `simplify('log(e, 9)')` . Thanks @quentintruong.
# 2021-01-16, version 9.0.0
- Improved support for bin, hex, and oct literals. See #1996. Thanks @clnhlzmn.
- **Breaking change**: parse literals with prefixes `0b`, `0c`, and `0x` are
now unsigned by default. To parse them as signed, you have to specify a
suffix specifying the word size such as `i16` or `i32`.
- Function `format` now supports more notations: `bin`, 'hex', and `oct`,
for example `format(255, {notation: "hex"})`.
- The functions `format`, `bin`, `hex`, `oct` now allow specifying a wordSize,
like `bin(10, 32)` and `format(10, {notation: "bin", wordSize: 32})`.
- BigNumber support for the bin, hex, and oct literals.
- Extended and improved the example rocket_trajectory_optimization.html.
Thanks @Josef37.
# 2020-12-30, version 8.1.1
- Improved the performance of parsing and evaluating units a lot, see #2065.
Thanks @flaviut.
- Upgraded dependency `fraction.js` to `v4.0.13`.
- Moved continuous integration testing from Travis CI to Github Workflow,
see #2024, #2041. Thanks @harrysarson.
# 2020-12-04, version 8.1.0
- Implemented units `kilogramforce` (`kgf`). Thanks @rnd-debug.
- Fix #2026: Implement a new option `fractionsLimit` for function `simplify`,
defaulting to `Infinity`.
- Improved the documentation of function `clone`. Thanks @redbar0n.
# 2020-11-09, version 8.0.1
- Fix #1979: missing "subset" dependency when using "mathjs/number" entry point.
- Fix #2022: update pretty printing with MathJax example to the latest version
of MathJax. Thanks @pkra.
# 2020-11-06, version 8.0.0
!!! BE CAREFUL: BREAKING CHANGES !!!
- You can now use mathjs directly in node.js using ES modules without need for
a transpiler (see #1928, #1941, #1962).
Automatically loading either commonjs code or ES modules code is improved.
All generated code is moved under `/lib`: the browser bundle is moved from
`/dist` to `/lib/browser`, ES module files are moved to `/lib/esm`,
and commonjs files are moved to `/lib/cjs`. Thanks @GreenImp.
- Non-minified bundle `dist/math.js` is no longer provided. Either use the
minified bundle, or create a bundle yourself.
- Replaced random library `seed-random` with `seedrandom`, see #1955.
Thanks @poppinlp.
- Breaking changes in `pickRandom`, see #1990, #1976.
- Will no longer return the input matrix when the given number is greater
than the length of the provided possibles. Instead, the function always
returns results with the requested number of picks.
- Will now return a `Matrix` as output when input was a `Matrix`.
- Introduced a new syntax:
```
math.pickRandom(array, { weights, number, elementWise })
```
- Introduced a new option `elementWise`, which is `true` by default.
When setting `elementWise` to false, an array containing arrays will return
random pick of arrays instead of the elements inside of the nested arrays.
# 2020-11-02, version 7.6.0
- Implemented function `rotate(w, theta)`. See #1992, #1160. Thanks @rnd-debug.
- Implemented support for custom characters in Units via `Unit.isValidAlpha`.
See #1663, #2000. Thanks @rnd-debug.
# 2020-10-10, version 7.5.1
- Fix object pollution vulnerability in `math.config`. Thanks Snyk.
# 2020-10-07, version 7.5.0
- Function `pickRandom` now allows randomly picking elements from matrices
with 2 or more dimensions instead of only from a vector, see #1974.
Thanks @KonradLinkowski.
# 2020-10-07, version 7.4.0
- Implemented support for passing a precision in functions `ceil`, `floor`,
and `fix`, similar to `round`, see #1967, #1901. Thanks @rnd-debug.
- Implemented function `rotationMatrix`, see #1160, #1984. Thanks @rnd-debug.
- Implement a clear error message when using `sqrtm` with a matrix having
more than two dimensions. Thanks @KonradLinkowski.
- Update dependency `decimal.js` to `10.2.1`.
# 2020-09-26, version 7.3.0
- Implemented functions `usolveAll` and `lsolveAll`, see #1916. Thanks @m93a.
- Implemented support for units in functions `std` and `variance`, see #1950.
Thanks @rnd-debug.
- Implemented support for binary, octal, and hexadecimal notation in the
expression parser, and implemented functions `bin`, `oct`, and `hex` for
formatting. Thanks @clnhlzmn.
- Fix #1964: inconsistent calculation of negative dividend modulo for
`BigNumber` and `Fraction`. Thanks @ovk.
# 2020-08-24, version 7.2.0
- Implemented new function `diff`, see #1634, #1920. Thanks @Veeloxfire.
- Implemented support for norm 2 for matrices in function `norm`.
Thanks @rnd-debug.
# 2020-07-13, version 7.1.0
- Implement support for recursion (self-referencing) of typed-functions,
new in `typed-function@2.0.0`. This fixes #1885: functions which where
extended with a new data type did not always work. Thanks @nickewing.
- Fix #1899: documentation on expression trees still using old namespace
`math.expression.node.*` instead of `math.*`.
# 2020-06-24, version 7.0.2
- Fix #1882: have `DenseMatrix.resize` and `SparseMatrix.resize` accept
`DenseMatrix` and `SparseMatrix` as inputs too, not only `Array`.
- Fix functions `sum`, `prod`, `min`, and `max` not throwing a conversion error
when passing a single string, like `sum("abc")`.
# 2020-05-30, version 7.0.1
- Fix #1844: clarify the documentation of function `eigs`. Thanks @Lazersmoke.
- Fix #1855: Fix error in the documentation for `math.nthRoots(x)`.
- Fix #1856: make the library robust against Object prototype pollution.
# 2020-05-07, version 7.0.0
Breaking changes:
- Improvements in calculation of the `dot` product of complex values.
The first argument is now conjugated. See #1761. Thanks @m93a.
- Dropped official support for Node.js v8 which has reached end of life.
- Removed all deprecation warnings introduced in v6.
To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first
and resolve all deprecation warnings.
# 2020-05-04, version 6.6.5
- Fix #1834: value `Infinity` cannot be serialized and deserialized.
This is solved now with a new `math.replacer` function used as
`JSON.stringify(value, math.replacer)`.
- Fix #1842: value `Infinity` not turned into the latex symbol `\\infty`.
# 2020-04-15, version 6.6.4
- Fix published files containing Windows line endings (CRLF instead of LF).
# 2020-04-10, version 6.6.3
- Fix #1813: bug in engineering notation for numbers of function `format`,
sometimes resulting in needless trailing zeros.
- Fix #1808: methods `.toNumber()` and `.toNumeric()` not working on a
unitless unit.
- Fix #1645: not being able to use named operators `mod`, `and`, `not`, `or`,
`xor`, `to`, `in` as object keys. Thanks @Veeloxfire.
- Fix `eigs` not using `config.epsilon`.
# 2020-03-29, version 6.6.2
- Fix #1789: Function `eigs` not calculating with BigNumber precision
when input contains BigNumbers.
- Run the build script during npm `prepare`, so you can use the library
directly when installing directly from git. See #1751. Thanks @cinderblock.
# 2020-02-26, version 6.6.1
- Fix #1725: simplify `a/(b/c)`. Thanks @dbramwell.
- Fix examples in documentation of `row` and `column`.
# 2020-02-01, version 6.6.0
- Implemented function `eigs`, see #1705, #542 #1175. Thanks @arkajitmandal.
- Fixed #1727: validate matrix size when creating a `DenseMatrix` using
`fromJSON`.
- Fixed `DenseMatrix.map` copying the size and datatype from the original
matrix instead of checking the returned dimensions and type of the callback.
- Add a caret to dependencies (like) `^1.2.3`) to allow downstream updates
without having to await a new release of mathjs.
# 2020-01-08, version 6.5.0
- Implemented `baseName` option for `createUnit`, see #1707.
Thanks @ericman314.
# 2020-01-06, version 6.4.0
- Extended function `dimension` with support for n-dimensional points.
Thanks @Veeloxfire.
# 2019-12-31, version 6.3.0
- Improved performance of `factorial` for `BigNumber` up to a factor two,
see #1687. Thanks @kmdrGroch.
# 2019-11-20, version 6.2.5
- Fixed `IndexNode` using a hardcoded, one-based implementation of `index`,
making it impossible to instantiate a zero-based version of the expression
parser. See #782.
# 2019-11-20, version 6.2.4
- Fixed #1669: function 'qr' threw an error if the pivot was zero,
thanks @kevinkelleher12 and @harrysarson.
- Resolves #942: remove misleading assert in 'qr'. Thanks @harrysarson.
- Work around a bug in complex.js where `sign(0)` returns complex NaN.
Thanks @harrysarson.
# 2019-10-06, version 6.2.3
- Fixed #1640: function `mean` not working for units. Thanks @clintonc.
- Fixed #1639: function `min` listed twice in the "See also" section of the
embedded docs of function `std`.
- Improved performance of `isPrime`, see #1641. Thanks @arguiot.
# 2019-09-23, version 6.2.2
- Fixed methods `map` an