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,348 lines (943 loc) • 120 kB
Markdown
# History
# 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` and `clone` not copying the `dotNotation` property of
`IndexNode`. Thanks @rianmcguire.
- Fixed a typo in the documentation of `toHTML`. Thanks @maytanthegeek.
- Fixed #1615: error in the docs of `isNumeric`.
- Fixed #1628: Cannot call methods on empty strings or numbers with value `0`.
# 2019-08-31, version 6.2.1
- Fixed #1606: function `format` not working for expressions.
# 2019-08-28, version 6.2.0
- Improved performance of `combinationsWithRep`. Thanks @waseemyusuf.
- Add unit aliases `bit` and `byte`.
- Fix docs referring to `bit` and `byte` instead of `bits` and `bytes`.
- Updated dependency `typed-function@1.1.1`.
# 2019-08-17, version 6.1.0
- Implemented function `combinationsWithRep` (see #1329). Thanks @waseemyusuf.
# 2019-08-05, version 6.0.4
- Fixed #1554, #1565: ES Modules where not transpiled to ES5, giving issues on
old browsers. Thanks @mockdeep for helping to find a solution.
# 2019-07-07, version 6.0.3
- Add `unpkg` and `jsdelivr` fields in package.json pointing to UMD build.
Thanks @tmcw.
- Fix #1550: nested user defined function not receiving variables of an
outer user defined function.
# 2019-06-11, version 6.0.2
- Fix not being able to set configuration after disabling function `import`
(regression since v6.0.0).
# 2019-06-09, version 6.0.1
- Fix function reference not published in npm library.
- Fix function `evaluate` and `parse` missing in generated docs.
# 2019-06-08, version 6.0.0
!!! BE CAREFUL: BREAKING CHANGES !!!
### Most notable changes
1. Full support for **ES modules**. Support for tree-shaking out of the box.
Load all functions:
```js
import * as math from 'mathjs'
```
Use a few functions:
```js
import { add, multiply } from 'mathjs'
```
Load all functions with custom configuration:
```js
import { create, all } from 'mathjs'
const config = { number: 'BigNumber' }
const math = create(all, config)
```
Load a few functions with custom configuration:
```js
import { create, addDependencies, multiplyDependencies } from 'mathjs'
const config = { number: 'BigNumber' }
const { add, multiply } = create({
addDependencies,
multiplyDependencies
}, config)
```
2. Support for **lightweight, number-only** implementations of all functions:
```
import { add, multiply } from 'mathjs/number'
```
3. New **dependency injection** solution used under the hood.
### Breaking changes
- Node 6 is no longer supported.
- Functions `config` and `import` are not available anymore in the global
context:
```js
// v5
import * as mathjs from 'mathjs'
mathjs.config(...) // error in v6.0.0
mathjs.import(...) // error in v6.0.0
```
Instead, create your own mathjs instance and pass config and imports
there:
```js
// v6
import { create, all } from 'mathjs'
const config = { number: 'BigNumber' }
const mathjs = create(all, config)
mathjs.import(...)
```
- Renamed function `typeof` to `typeOf`, `var` to `variance`,
and `eval` to `evaluate`. (the old function names are reserved keywords
which can not be used as a variable name).
- Deprecated the `Matrix.storage` function. Use `math.matrix` instead to create
a matrix.
- Deprecated function `math.expression.parse`, use `math.parse` instead.
Was used before for example to customize supported characters by replacing
`math.parse.isAlpha`.
- Moved all classes like `math.type.Unit` and `math.expression.Parser` to
`math.Unit` and `math.Parser` respectively.
- Fixed #1428: transform iterating over replaced nodes. New behavior
is that it stops iterating when a node is replaced.
- Dropped support for renaming factory functions when importing them.
- Dropped fake BigNumber support of function `erf`.
- Removed all index.js files used to load specific functions instead of all, like:
```
// v5
// ... set up empty instance of mathjs, then load a set of functions:
math.import(require('mathjs/lib/function/arithmetic'))
```
Individual functions are now loaded simply like:
```js
// v6
import { add, multiply } from 'mathjs'
```
To set a specific configuration on the functions:
```js
// v6
import { create, addDependencies, multiplyDependencies } from 'mathjs'
const config = { number: 'BigNumber' }
const math = create({ addDependencies, multiplyDependencies }, config)
```
See example `advanced/custom_loading.js`.
- Updated the values of all physical units to their latest official values.
See #1529. Thanks @ericman314.
### Non breaking changes
- Implemented units `t`, `tonne`, `bel`, `decibel`, `dB`, and prefixes
for `candela`. Thanks @mcvladthegoat.
- Fixed `epsilon` setting being applied globally to Complex numbers.
- Fix `math.simplify('add(2, 3)')` throwing an error.
- Fix #1530: number formatting first applied `lowerExp` and `upperExp`
and after that rounded the value instead of the other way around.
- Fix #1473: remove `'use strict'` in every file, not needed anymore.
# 2019-05-18, version 5.10.3
- Fixed dependency `del` being a dependency instead of devDependency.
# 2019-05-18, version 5.10.2
- Fix #1515, #1516, #1517: broken package due to a naming conflict in
the build folder of a util file `typeOf.js` and `typeof.js`.
Solved by properly cleaning all build folders before building.
# 2019-05-17, version 5.10.1
- Fix #1512: format using notation `engineering` can give wrong results
when the value has less significant digits than the number of digits in
the output.
# 2019-05-08, version 5.10.0
- Fix `lib/header.js` not having filled in date and version. Thanks @kevjin.
- Upgraded dependency `decimal.js@10.2.0`, fixing an issue on node.js 12.
# 2019-04-08, version 5.9.0
- Implemented functions `row` and `column` (see #1413). Thanks @SzechuanSage.
- Fixed #1459: `engineering` notation of function `format` not available
for `BigNumber`.
- Fixed #1465: `node.toHTML()` not correct for unary operators like
`factorial`.
# 2019-03-20, version 5.8.0
- Implemented new function `apply`. Thanks @bnlcas.
- Implemented passing an optional `dimension` argument to `std` and `var`.
Thanks @bnlcas.
# 2019-03-10, version 5.7.0
- Implemented support for `pow()` in `derivative`. Thanks @sam-19.
- Gracefully handle round-off errors in fix, ceil, floor, and range
(Fixes #1429, see also #1434, #1432). Thanks @ericman314.
# 2019-03-02, version 5.6.0
- Upgrade decimal.js to v10.1.1 (#1421).
- Fixed #1418: missing whitespace when stringifying an expression
containing "not".
# 2019-02-20, version 5.5.0
- Fixed #1401: methods `map` and `forEach` of `SparseMatrix` not working
correctly when indexes are unordered.
- Fixed #1404: inconsistent rounding of negative numbers.
- Upgrade tiny-emitter to v2.1.0 (#1397).
# 2019-01-25, version 5.4.2
- Fixed `math.format` not working for BigNumbers with a precision above
1025 digits (see #1385). Thanks @ericman314.
- Fixed incorrect LaTeX output of `RelationalNode`. Thanks @rianmcguire.
- Fixed a bug the methods `map`, `forEach`, `traverse`, and `transform`
of `FunctionNode`.
# 2019-01-10, version 5.4.1
- Fix #1378: negative bignumbers not formatted correctly.
- Upgrade fraction.js to version 4.0.12 (#1369).
# 2018-12-09, version 5.4.0
- Extended sum.js to accept a dimension input to calculate the sum over a
specific axis. Thanks @bnlcas.
- Fix #1328: objects can't be written multi-line. Thanks @GHolk.
- Remove side effects caused by `Unit.format` and `Unit.toString`,
making changes to the unit on execution. Thanks @ericman314.
# 2018-12-03, version 5.3.1
- Fixed #1336: Unit.toSI() returning units with prefix like `mm` instead
of `m`. Thanks @ericman314.
# 2018-11-29, version 5.3.0
- Implemented function `hasNumericValue`. Thanks @Sathish-kumar-Subramani.
- Fix #1326: non-ascii character in print.js.
- Fix #1337: `math.format` not working correctly with `{ precision: 0 }`.
Thanks @dkenul.
# 2018-10-30, version 5.2.3
- Fixed #1293: non-unicode characters in `escape-latex` giving issues in some
specific cases. Thanks @dangmai.
- Fixed incorrect LaTeX output of function `bitNot`, see #1299. Thanks @FSMaxB.
- Fixed #1304: function `pow` not supporting inputs `pow(Unit, BigNumber)`.
- Upgraded dependencies (`escape-latex@1.2.0`)
# 2018-10-23, version 5.2.2
- Fixed #1286: Fixed unit base recognition and formatti