UNPKG

127 kBMarkdownView Raw
1# History
2
3# 2024-01-30, 14.2.0
4
5- Feat: #3041, #3340 rename `apply` to `mapSlices` (#3357). Function
6 `apply` is still available but is now marked deprecated. Thanks @gwhitney.
7- Fix: #3247 don't override type-native floor/ceil within tolerance of value
8 (#3369). Thanks @gwhitney.
9- Fix: #3360 add bigint support to matrix indices and ranges (#3361).
10 Thanks @gwhitney.
11- Fix: #3115 type definitions for matrixFrom* (#3371). Thanks @Hudsxn
12 and @gwhitney.
13
14# 2025-01-24, 14.1.0
15
16- Feat: implement `bigint` support in functions `log`, `log2`, `log10`,
17 `larger`, `smaller`, `max`, `min` (#3345). Thanks @gwhitney.
18- Fix: #3342 hexadecimal input not turned into a `bigint` (#3348).
19- Fix `randomInt()` not working (#3345).
20- Docs: fixed description of `sign` in the embedded docs (#3338).
21 Thanks @witer33.
22
23# 2024-12-11, 14.0.1
24
25- Fix: make derivative much faster (#3322). Thanks @paulftw.
26- Fix: #3317 export `Fraction` type from the `fraction.js` library instead of
27 using a custom interface (#3330). Thanks @fchu.
28
29# 2024-11-20, 14.0.0
30
31!!! BE CAREFUL: BREAKING CHANGES !!!
32
33- Feat: Upgrade to `fraction.js@5`, using `bigint` under the hood (#3283).
34- Feat: Implement support for `Unit` in functions `ceil`, `floor`, and `fix`.
35 Possible breaking changes in the type definitions of arrays and matrices
36 due to the introduction of generics (#3269). Thanks @orelbn.
37- Feat: Implement support for `log(x: Fraction, base: Fraction)`.
38- Fix: #3301 precedence of `%` (mod) being higher than `*` and `/` (#3311).
39 Thanks @nkumawat34.
40- Fix: #3222 prevent `math.import(...)` from overriding units unless you
41 specify `{ override: true }` (#3225).
42- Fix: #3219 let functions `dotDivide`, `dotPow`, `bitXor`, `xor`, `equal`,
43 `larger`, `largerEq`, `smaller`, `smallerEq`, and `unequal` return a sparse
44 matrix when the input is two sparse matrices (#3307). Thanks @Aakash-Rana.
45- Fix: Improve type definitions of arrays (#3306). Thanks @orelbn.
46
47# 2024-11-20, 13.2.3
48
49- Fix: #3260 improve type definitions and documentation on the callback
50 indices of `map`, `filter`, and `forEach`.
51- Fix: #3323 support functions in function `clone`.
52- Docs: fix a broken link in the documentation (#3316).
53 Thanks @emmanuel-ferdman.
54
55# 2024-11-13, 13.2.2
56
57- Fix: #1455 implicit multiplication of a fraction with unit `in` is incorrect
58 (#3315). Thanks @nkumawat34.
59
60# 2024-11-06, 13.2.1
61
62- Update to the latest version of `complex.js`.
63- Fix `Index.dimension(dim)` accepting non-numeric input.
64- Fix: #3290 should validate variables names in method `Parser.set` (#3308).
65 Thanks @nkumawat34.
66
67# 2024-10-02, 13.2.0
68
69- Feat: improve performance of functions `map`, `filter` and `forEach` (#3256).
70 Thanks @dvd101x.
71- Feat: improve performance of the methods `map()` and `forEach()`
72 of `DenseMatrix` (#3251). Thanks @Galm007.
73- Fix: #3253 cannot use identifiers containing special characters in function
74 `derivative`.
75- Fix: improve the type definitions of `ConstantNode` to support all data
76 types (#3257). Thanks @smith120bh.
77- Fix: #3259 function `symbolicEqual` missing in the TypeScript definitions.
78- Fix: #3246 function `leafCount` missing in the TypeScript definitions.
79- Fix: #3267 implicit multiplication with a negative number and unit `in`.
80- Docs: fix broken links on the Configuration page. Thanks @vassudanagunta.
81- Docs: document the syntax of `map` and `forEach` in the expression parser
82 (#3272). Thanks @dvd101x.
83
84# 2024-08-27, 13.1.1
85
86- Fix security vulnerability in the CLI and web API allowing to call functions
87 `import`, `createUnit` and `reviver`, allowing to get access to the internal
88 math namespace and allowing arbitrary code execution. Thanks @StarlightPWN.
89- Fix security vulnerability: when overwriting a `rawArgs` function with a
90 non-`rawArgs` function, it was still called with raw arguments. This was both
91 a functional issue and a security issue. Thanks @StarlightPWN.
92- Fix security vulnerability: ensure that `ObjectWrappingMap` cannot delete
93 unsafe properties. Thanks @StarlightPWN.
94- Fix: not being able to use methods and properties on arrays inside the
95 expression parser.
96
97# 2024-08-26, 13.1.0
98
99- Feat: support multiple inputs in function `map` (#3228, #3196).
100 Thanks @dvd101x.
101- Feat: add matrix datatypes in more cases (#3235). Thanks @dvd101x.
102- Feat: export util functions `isMap`, `isPartitionedMap`, and
103 `isObjectWrappingMap`.
104- Fix: #3241 function `map` not always working with matrices (#3242).
105 Thanks @dvd101x.
106- Fix: #3244 fix broken link to `ResultSet` in the docs about classes.
107- Docs: add a link to the documentation page about the syntax expression
108 from the function `evaluate` (see #3238).
109- Docs: improve the documentation of `scope` and fix the example
110 `custom_scope_objects.js` (#3150)
111- Docs: spelling fixes in the embedded docs (#3252). Thanks @dvd101x.
112
113# 2024-07-19, 13.0.3
114
115- Fix: #3232 fix type definitions of function `format` to support notations
116 `hex`, `bin`, and `oct`.
117- Fix: use more precise definitions for US liquid volume units (#3229).
118 Thanks @Vistinum.
119- Fix: #2286 types static methods and members for Unit class (#3230).
120 Thanks @orelbn.
121
122# 2024-07-04, 13.0.2
123
124- Fix an error in the type definitions of `quantileSeq` (#3223).
125 Thanks @domdomegg.
126
127# 2024-06-28, 13.0.1
128
129- Fix: #3227 generated bundle containing `catch` blocks without parameters.
130- Fix: #2348 update type definitions of the `Parser` methods (#3226).
131 Thanks @orelbn.
132
133# 2024-05-31, 13.0.0
134
135Breaking changes:
136
137- Change `isZero`, `isPositive`, and `isNegative` to respect `config.epsilon`
138 (#3139, #2838).
139- Change the behavior of the internal `nearlyEqual` to align with Python and
140 Julia (#3152, #2838)
141- Upgrade to `fraction.js@4.3.7`,
142 see <https://github.com/rawify/Fraction.js/issues/68>.
143- Dropped support for JavaScript engines that do not fully support ES6 or
144 `bigint`, or are not actively maintained. ES2020 is now the minimum required
145 EcmaScript version.
146
147Non-breaking changes:
148
149- Implemented support for `bigint` (#3207, #3207)
150- Implemented a new config option `config.numberFallback` needed for `bigint`
151 (#3207).
152- Internal: refactored tooling to ES modules and upgraded all devDependencies.
153
154# 2024-05-31, 12.4.3
155
156- Fix: serialization of Units without a value, see #1240.
157- Fix: outdated, incorrect documentation about the order of precedence for
158 operator modulus `%`. See #3189.
159- Fix: #3197 improve `quantileSeq` type definitions (#3198). Thanks @domdomegg.
160
161# 2024-04-24, 12.4.2
162
163- Fix #3192: function `isNaN` returns `false` for `NaN` units in a matrix or
164 array (#3193). Thanks @lgerin.
165- Fix: #3180 fix type definitions of functions `add` and `multiply` to allow
166 more than two arguments.
167- Docs: correct the docs about `traverse` returning void (#3177).
168 Thanks @rohildshah.
169
170# 2024-03-13, 12.4.1
171
172- Docs: implement an interactive version of the Lorenz example, and show the
173 chart full screen (#3151). Thanks @dvd101x.
174- Fix #3172: simplify `"true and true"`.
175- Fix #3163: `toTex` wrongly returning `Infinity` for large BigNumbers.
176- Fix #3162: add license information about CSParse (#3164).
177- Fix #3175: cannot delete units using `math.Unit.deleteUnit`.
178- Fix: faster startup time of the CLI and REPL by loading the bundle.
179- Fix: remove using polyfill.io inside the example
180 `pretty_printing_with_mathjax.html` (#3167). Thanks @SukkaW.
181
182# 2024-02-22, 12.4.0
183
184- Feat: implement support for trailing commas in matrices (#3154, #2968).
185 Thanks @dvd101x.
186- Feat: improve the performance of `multiply` a lot by adding matrix type
187 inferencing (#3149). Thanks @RandomGamingDev.
188- Fix: #3100 function `round` not handling round-off errors (#3136).
189 Thanks @BrianFugate.
190- Fix: `PartitionedMap` and `ObjectWrappingMap` missing a property
191 `Symbol.iterator`, causing problems when trying `new Map(scope)` (#3156).
192- Fix: type definitions of function `mode` (#3153). Thanks @rich-martinez.
193- Docs: describe method `getAllAsMap` in the Parser docs (#3158, #3157).
194 Thanks @dvd101x.
195
196# 2024-02-08, 12.3.2
197
198- Improved the performance of custom defined functions in the expression
199 parser (#3150).
200- Fix: #3143 cannot use `and` and `or` inside a function definition.
201 Regression since `v12.1.0` (#3150).
202
203# 2024-02-01, 12.3.1
204
205- Improved the typings of the arguments of `ArrayNode`, `FunctionNode`,
206 `IndexNode`, `OperatorNode`, and `RelationalNode` (#3123). Thanks @sylee957.
207- Added a fully featured code editor example with CodeMirror and Katex (#3027).
208 Thanks @dvd101x.
209- Fix: #3114 build warnings related to a number of wrong `/* #__PURE__ */`
210 annotations.
211- Fix: #3142 support BigNumber values for the options of function `format`:
212 `precision`, `wordSize`, `lowerExp`, `upperExp`. Support BigNumber values
213 for the option `wordSize` in the functions `hex`, `bin`, and `oct`.
214- Fix: #3125 type definitions of function `hypot` (#3144).
215 Thanks @silentmissile.
216- Fix: #3141 `help(config)` altering the actual `config` when evaluating the
217 examples.
218- Docs: #3145 fix documentation about REPL, it does require a build step
219 nowadays.
220
221# 2024-01-12, 12.3.0
222
223- Implement support new metric prefixes: `ronna` (`R`), `quetta` (`Q`),
224 `ronto` (`r`), and `quecto` (`q`) (#3113, #3112). Thanks @AlexEdgcomb.
225- Fix a bug converting a unitless unit (#3117). Thanks @costerwi.
226- Fix: #3097 `toSI()` wrongly converting `degC` (#3118). Thanks @costerwi.
227
228# 2023-12-20, 12.2.1
229
230- Fix #3109: method `Node.toHTML` not accepting a custom `handler`.
231
232# 2023-12-08, 12.2.0
233
234- Feat: lazy evaluation of operators `and`, `or`, `&`, `|` (#3090, #3101,
235 #2766). Thanks @smith120bh.
236- Fix: passing a 4th argument with a scope to raw functions.
237- Fix: #3096 embedded docs of eigs throwing an error.
238
239# 2023-11-17, 12.1.0
240
241- Feat: Extend function `round` with support for units (#2761, #3095).
242- Feat: Extend function `mod` with support for negative divisors in when
243 using `BigNumber` or `Fraction` (#3087).
244- Fix: #3092 a typo in an error message when converting a string into a number.
245- Fix: #3094 function `derivative` mutates the input expression when it fails.
246
247# 2023-10-26, 12.0.0
248
249Breaking changes:
250
251- Fix #2879, #2927, #3014: change the confusing interface of `eigs` (#3037),
252 thanks @gwhitney.
253 Before, functions `eigs` returned an object:
254
255 ```
256 { values: MathCollection; vectors: MathCollection }
257 ```
258
259 where `vectors` was a 2d matrix of which the columns contained the vectors.
260 This is changed to `eigs` returning an object:
261
262 ```
263 {
264 values: MathCollection
265 eigenvectors: Array<{
266 value: number | BigNumber
267 vector: MathCollection
268 }>
269 }
270 ```
271
272 Where `eigenvectors` is an array containing an object with the corresponding
273 eigenvalue and vector.
274- Refactored the TypeScript type definitions to make them work with a `NodeNext`
275 module resolution (#3079, #2919).
276 - Type `MathJsStatic` is renamed to `MathJsInstance`.
277 - Type `FactoryDependencies` is deprecated, use `MathJsFactory` instead, and
278 import dependency maps directly from the library.
279- Change the assignment operator of `.toTex()` output from `:=` to `=` (see
280 #2980, #2987).
281- Drop official support for Node.js 14 and 16.
282
283Features:
284
285- Function `eigs` now has an option to turn off calculation of eigenvectors
286 (#3057, #2180). Thanks @gwhitney.
287
288Fixes:
289
290- Find eigenvectors of defective matrices (#3037). Thanks @gwhitney.
291
292# 2023-10-26, 11.12.0
293
294- Implemented function `subtractScalar` (#3081, #2643), thanks @vrushaket.
295- Fix #3073: function format not escaping control characters and double
296 quotes (#3082).
297- Fix: function `clone` not throwing an error when passing an unsupported
298 type like a function.
299- Fix: #2960 add type definition of function `symbolicEqual` (#3035),
300 thanks @juancodeaudio.
301
302# 2023-10-11, 11.11.2
303
304- Fix #3025: improve handling of matrices and error handling
305 in function `corr` (#3030). Thanks @vrushaket.
306- Fix #3074: improve error message when using function `max` in `derivative`.
307- Fix #3073: fix parsing quotes inside a string.
308- Fix #2027: cannot use named operators like `to` or `mod` as property name.
309
310# 2023-09-20, 11.11.1
311
312- Fix #2989: use one-based indices in `print` in the parser (#3009).
313 Thanks @dvd101x.
314- Fix #2936: `mod` sometimes giving wrong results due to internal round-off
315 errors (#3011). Thanks @praisennamonu1.
316- Internal refactor of `quantileSeq`, and fixed the embedded help (#3003).
317 Thanks @dvd101x.
318- Updated dependencies and devDependencies.
319
320# 2023-09-05, 11.11.0
321
322- Implement function `corr` to calculate the correlation between two matrices
323 (#3015, #2624). Thanks @vrushaket.
324- Lock `fraction.js` at version `4.3.4` for now, see #3024, 3022,
325 <https://github.com/rawify/Fraction.js/issues/68>.
326
327# 2023-08-31, 11.10.1
328
329- Upgrade to `fraction.js@4.3.4`, see #3022.
330- Fix #3020: `lruQueue` using the global `hasOwnProperty` which may be
331 polluted.
332- Add support for prefixes for the unit `erg`, and restrict prefixes of the
333 unit `joule` to only long prefixes like `kilo` and no short prefixes
334 like `k` (#3019). Thanks @costerwi.
335- Add a new browser example `examples/browser/lorenz.html` that uses `solveODE`
336 and plots the result in a chart (#3018). Thanks @dvd101x.
337
338# 2023-08-23, 11.10.0
339
340- Extend function `quantileSeq` with support for a `dimension` (#3002).
341 Thanks @dvd101x.
342- Implement #2735: Support indexing with an array of booleans, for
343 example `a[[true, false, true]]` and `a[a > 2]` (#2994). Thanks @dvd101x.
344- Implement function `zeta` (#2950, #2975, #2904). Thanks @Bobingstern.
345- Fix #2990: `DenseMatrix` can mutate input arrays (#2991).
346
347# 2023-07-24, 11.9.1
348
349- Fix a security vulnerability in `FunctionNode` and `SymbolNode` allowing
350 arbitrary code execution via `math.evaluate`. Thanks Harry Chen.
351- Fix #3001: mathjs bundle containing `new Function(...)` (CSP issue).
352
353# 2023-07-19, 11.9.0
354
355- Implement function `solveODE` (#2958). Thanks @dvd101x.
356- Implement functions `zpk2tf` and `freqz` (#2988, #2969). Thanks @alykhaled.
357- Implement support for units in function `range` (#2997). Thanks @dvd101x.
358- Fix #2974: `simplify` puts plus and minus signs next to each other (#2981).
359 Thanks @MaybePixem.
360- Fix #2973: fixes and improvements in the embedded docs (#2976).
361 Thanks @dvd101x.
362- Fix #2996: two errors in the examples in the documentation about Expression
363 trees.
364- Fix round-off errors near zero when converting temperatures (#2962).
365 Thanks @costerwi.
366- Refactored function `range`, reducing the amount of code (#2995).
367 Thanks @dvd101x.
368
369# 2023-06-20, 11.8.2
370
371- Fix #2971: improve typings of statistics functions `min`, `max`, `mean`,
372 `median`, `mode`, `std`, `sum`, `prod`, `variance`. Fixes a regression
373 introduced in v11.8.1.
374- Fix #2972: type definitions of `Unit.divide(Unit)` have a wrong return type.
375
376# 2023-06-13, 11.8.1
377
378- Fix #2964: issue in function `distance` when calculate the distance from
379 a point to a line (#2965). Thanks @Kiku-CN.
380- Fix `math.format` not working correctly for `engineering` notation when using
381 BigNumbers and for `fixed` notation with `precision: 0` configured (#2956).
382 Thanks @mgreminger.
383- Fix #2880: not possible to map cube root `cbrt`.
384- Fix #2938: make the syntax description of all functions consistent in the
385 docs (#2941). Thanks @dvd101x.
386- Fix #2954: improve the TypeScript definitions the return type of functions
387 `min` and `max` (#2955). Thanks @Maxim-Mazurok.
388- Fix #2959: typo in an example in the docs. Thanks @kunalagrwl.
389- Drop official support for Node.js 14, has reached end of life.
390
391# 2023-04-03, 11.8.0
392
393- Extended functions `fraction`, `bignumber`, and `number` with support for
394 units, see #2918 (#2926).
395- Implemented aliases `amp` and `amps` for unit `ampere` (#2917).
396 Thanks @veggiesaurus.
397- Improve TypeScript definitions of function `gcd` (#2922). Thanks @brunoSnoww.
398- Fix #2923: improve docs of the function `distance` (#2924). Thanks @tmtron.
399
400# 2023-03-15, 11.7.0
401
402- Implement #2567: accept array as parameter for function `gcd` (#2878).
403 Thanks @jakubriegel.
404- Fix #2908: improvements in the docs and examples of functions
405 `partitionSelect`, `diff`, `expm1`, `round`, `nthRoots`, `sign`,
406 `rigthArithShift`, `setIsSubset`, `setSize`, and the docs about units.
407 Thanks @tmtron.
408- Fix #2907: determinant of empty matrix should be 1.
409- Refactor index.d.ts by writing function declarations using a generic,
410 reducing a lot of repetition (#2913). Thanks @brunoSnoww.
411
412# 2023-02-24, 11.6.0
413
414- Implement broadcasting for the following functions and their corresponding
415 operator: `add`, `dotDivide`, `dotMultiply`, `dotPow`, `gcd`, `lcm`, `mod`,
416 `nthRoot`, `subtract`, `bitAnd`, `bitOr`, `bitXor`, `leftShift`,
417 `rightArithShift`, `rightLogShift`, `and`, `or`, `xor`, `compare`,
418 `compareText`, `equal`, `larger`, `largerEq`, `smaller`, `smallerEq`,
419 `unequal`, `atan2` and `to` (#2895, #2753). Thanks @dvd101x.
420- Implement support for non-power-of-2 fft (#2900, #2577). Thanks @cyavictor88.
421- Fix #2888: update type definitions of function `unit` to allow creating a
422 unit from a fraction or complex number.
423- Fix #2892: an error in the examples of the embedded help of function `sort`.
424- Fix #2891: functions `column` and `row` sometimes returning a scalar number.
425- Fix #2896: define the fourth argument of function `intersect` as optional
426 in the TypeScript definitions. Thanks @wodndb.
427- Fix: quantileSeq not accepting a matrix as second argument `prob` (see #2902).
428- Fix broken examples in functions `to`, `distance`, `getMatrixDataType`,
429 `subset`, and `max` (see #2902).
430
431# 2023-01-31, 11.5.1
432
433- Add type definitions for function `rotationMatrix` (#2860).
434 Thanks @brunoSnoww.
435- Add type signature for `lusolve(LUDecomposition, ...)` (#2864).
436 Thanks @evanmiller.
437- Fix #2873: the rocket_trajectory_optimization.html example being partly
438 broken. Thanks @dvd101x.
439- Fix #2871: coverage report broken (#2877). Thanks @bornova.
440- Fix #2883: update documentation for stat functions, describe missing syntax.
441- Fix #2884: fix examples in the embedded docs of function `pow` and some other
442 functions.
443- Fix type definition of function `complex` for one numeric input (#2886),
444 thanks @ariymarkowitz.
445- Fix type definitions of `map()` and `forEach()` (#2887), thanks @xiaohk.
446- Fix #2606: improve type definitions of `dotMultiply`, `dotPow` and
447 `dotDivide` (#2890). Thanks @brunoSnoww.
448
449# 2022-12-05, 11.5.0
450
451- Improve `simplify` rule matches in non-commutative contexts (#2841).
452 Thanks @samueltlg.
453- Simplify: add rules and restructure tests for non-commutative contexts
454 (#2847). Thanks @samueltlg.
455- Fix function `reshape` mutating the input in case of a matrix (see #2854).
456- Fix TypeScript types for `multiply()` with `number[]` and `number[][]`
457 (#2852). Thanks @hfhchan.
458
459# 2022-11-18, 11.4.0
460
461- Implemented more wildcards to describe rules for `simplify`, making it easier
462 for example to describe unary minus (#1915). Thanks @thatcomputerguy0101.
463- Implemented functions `schur`, `sylvester`, and `lyap` (#2646).
464 Thanks @egidioln.
465- Implemented function `polynomialRoot`, and use it in a benchmark (#2839).
466 Thanks @gwhitney.
467- Fix #2825 partly: improve simplifying operations on constants in
468 non-commutative contexts (#2827). Thanks @samueltlg.
469- Fix #2840: a bug in the docs and type definitions of `Node.traverse` and
470 `Node.forEach`, they do return `void`.
471
472# 2022-11-07, 11.3.3
473
474- Fix #2830: Prevent inserting zero values when creating a `SparseMatrix` from a
475 `DenseMatrix` (#2836). Thanks @AlexandreAlvesDB.
476- Fix #2835: a regression in the type definitions of `FunctionNode`, introduced
477 in `v11.3.2`. See #2733. Thanks @dsteve.
478
479# 2022-10-25, 11.3.2
480
481- Add generics to remaining Node type definitions (#2733). Thanks @mattvague.
482- Allow unit prefixes for (absolute) temperatures `kelvin`, `rankine`,
483 `celsius`, and `fahrenheit` (#2824). Thanks @jfeist
484
485# 2022-10-19, 11.3.1
486
487- Fix #2809: code completion issues in some IDE's (#2812).
488- Fix #2818: throw an error when a function assignment has duplicate
489 parameter names (#2819).
490- Update `decimal.js` to version `10.4.2`.
491
492# 2022-10-11, 11.3.0
493
494- Allow creating new subclasses of `Node` in TypeScript (#2772).
495 Note that this disables being able to narrow MathNodes by using the `.type`
496 property. Use typeguards like `isOperatorNode(...)` instead (see #2810).
497 Thanks @mattvague.
498- Fix #2793: `flatten()` cloning entries of array/Matrix (#2799).
499- Fix #2627: TypeScript definitions of `pinv` missing (#2804).
500 Thanks @HanchaiN.
501- Update dependencies to `decimal.js@10.4.1`.
502
503# 2022-09-13, 11.2.1
504
505- Fix doc generator being broken, not generating a function reference.
506
507# 2022-09-12, 11.2.0
508
509- Implement function `isRelationalNode` (#2731). Thanks @isaacbyr.
510- Added missing types `'largerEq'` and `'or'` in `OperatorNodeMap` in the
511 TypeScript definitions. Thanks @ajinkyac03.
512- Fixed typos in min func type defs (#2768). Thanks @mabdullahadeel.
513- Improved the TypeScript definitions for `pickRandom`. Thanks @mattvague.
514- Fixed documentation of unit `min` which means `minutes`, not `minim` (#2773).
515 Thanks @jasonhornsby.
516
517# 2022-08-23, 11.1.0
518
519- Add Unit constructor from value and pure (valueless) Unit (#2628).
520 Thanks @costerwi
521- Fix #2144: `examples/advanced/custom_loading.js` was broken.
522- Fix JSON `replacer` function missing in the TypeScript definitions.
523 Thanks @mattvague.
524- Update dependencies to `typed-function@4.1.0` and `decimal.js@10.4.0`.
525
526# 2022-07-25, version 11.0.1
527
528- Fix #2632: TypeScript issue of `simplifyConstant` and `simplifyCore`
529 not having a return type defined.
530
531# 2022-07-23, version 11.0.0
532
533!!! BE CAREFUL: BREAKING CHANGES !!!
534
535Breaking changes:
536
537- Dropped official support for IE11.
538- 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:
539 - Conversions now have preference over `any`.
540 - The `this` variable is no longer bound to the typed function itself.
541 - The properties `typed.types`, `typed.conversions`, and `typed.ignore`
542 have been removed.
543 - There are new static functions available like `typed.referTo`,
544 `typed.referToSelf`, `typed.addTypes`, `typed.addConversions`.
545- Implement amended "Rule 2" for implicit multiplication (#2370, #2460):
546 when having a division followed by an implicit multiplication, the division
547 gets higher precedence over the implicit multiplication when (a) the
548 numerator is a constant with optionally a prefix operator (`-`, `+`, `~`),
549 and (b) the denominator is a constant. For example: formerly `-1 / 2 x` was
550 interpreted as `-1 / (2 * x)` and now it is interpreted as `(-1 / 2) * x`.
551 Thanks @gwhitney.
552- Drop elementwise matrix support for trigonometric functions, exp, log, gamma,
553 square, sqrt, cube, and cbrt to prevent confusion with standard matrix
554 functions (#2440, #2465). Instead, use `math.map(matrix, fn)`.
555 Thanks @gwhitney.
556- Simplify: convert equivalent function calls into operators, for example,
557 `add(2, x)` will now be simplified into `2 + x` (#2415, #2466).
558 Thanks @gwhitney.
559- Removed the automatic conversion from `number` to `string` (#2482).
560 Thanks @gwhitney.
561- Fix #2412: let function `diff` return an empty matrix when the input contains
562 only one element (#2422).
563- Internal refactoring in the `simplifyCore` logic (#2490, #2484, #2459).
564 The function `simplifyCore` will no longer (partially) merge constants, that
565 behavior has been moved to `simplifyConstant`. The combination of
566 `simplifyConstant` and `simplifyCore` is still close to the old behavior
567 of `simplifyCore`, but there are some differences. To reproduce the same
568 behavior as the old `simplifyCore`, you can use
569 `math.simplify(expr, [math.simplifyCore, math.simplifyConstant])`.
570 Thanks to the refactoring, `simplify` is more thorough in reducing constants.
571 Thanks @gwhitney.
572- Disable support for splitting rest parameters in chained calculations
573 (#2485, #2474). For example: `math.chain(3).max(4, 2).done()` will now throw
574 an error rather than return `4`, because the rest parameter of
575 `math.max(...number)` has been split between the contents of the chain and
576 the arguments to the max call. Thanks @gwhitney.
577- Function `typeOf` now returns `function` (lowercase) for a function instead
578 of `Function` (#2560). Thanks @gwhitney.
579
580Non-breaking changes:
581
582- Fix #2600: improve the TypeScript definitions of `simplify`.
583 Thanks @laureen-m and @mattvague.
584- Fix #2607: improve type definition of `createUnit`. Thanks @egziko.
585- Fix #2608: clarify the docs on the need to configure a smaller `epsilon`
586 when using BigNumbers.
587- Fix #2613: describe matrix methods `get` and `set` in the docs.
588- Fix link to `math.rationalize` in the docs (#2616). Thanks @nukisman.
589- Fix #2621: add TypeScript definitions for `count` (#2622). Thanks @Hansuku.
590- Improved TypeScript definitions of `multiply` (#2623). Thanks @Windrill.
591
592# 2022-06-28, version 10.6.4
593
594- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
595
596# 2022-06-24, version 10.6.3
597
598- Revert the TypeScript definition fixes for `factory` applied in `v10.6.2`,
599 they give some complications.
600
601# 2022-06-24, version 10.6.2
602
603- Improve TypeScript definitions of `ParenthesisNode`. Thanks @mattvague.
604- Change the TypeScript definition of `MathNodeCommon['type']` into a less
605 strict string, so it is possible to extend with new Node classes.
606 Thanks @mattvague.
607- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
608
609# 2022-05-31, version 10.6.1
610
611- Improve the TypeScript types For `OperatorNode`: you can now define generic
612 types like `OperatorNode<'+', 'add'>`. Thanks @mattvague.
613
614# 2022-05-24, version 10.6.0
615
616- Implementation of Fourier transform functions `fft` and `ifft` (#2540).
617 Thanks @HanchaiN.
618- Fix TypeScript types not being listed in the exported fields (#2569).
619 Thanks @mattvague.
620- Large improvements in TypeScript definitions for chained expressions (#2537).
621 Thanks @mattvague.
622- Fix #2571: improve TypeScript definition of functions `clone` and `cloneDeep`
623 (#2572). Thanks @mattvague.
624- Fix the first argument of `derivative` holding the expression not correctly
625 being converted when using `.toTex()` (#2564). Thanks @mattvague.
626
627# 2022-05-11, version 10.5.3
628
629- Fix #2337: npm package containing examples and docs to solve security
630 vulnerabilities being reported on the examples and their dependencies.
631- Fix core, construction, and some other functions missing in docs.
632- Drop official support for Node.js 12 which has reached its end of life.
633
634# 2022-05-09, version 10.5.2
635
636- Fix #2553: `@types/mocha` defined in `dependencies` instead of
637 `devDependencies`, causing problems in projects that use a different version
638 of this dependency. Thanks @Kolahzary.
639- Fix #2550: remove `examples/node_modules` folder from the npm package.
640- Fix #2528: improve contribution guidelines (#2548).
641- Document `SymbolNode.onUndefinedSymbol` and
642 `FunctionNode.onUndefinedFunction`.
643
644# 2022-05-02, version 10.5.1
645
646- Fix #2526, #2529: improve TypeScript definitions of function `round`, `fix`,
647 `floor`, `ceil`, and `nthRoot`, and improved the number only implementations
648 of those functions (#2531, #2539). Thanks @simlaticak and @gwhitney.
649- Fix #2532: matrix index symbol `end` not working when used inside
650 a sub-expression.
651- Fix #2524: In generating AUTHORS list, ignore a list of specific commits
652 (e.g., to avoid spurious duplicates in list). (#2543)
653- Add type definitions of function `resolve` (#2536). Thanks @mattvague.
654
655# 2022-04-19, version 10.5.0
656
657- Implement #1563: function `pinv`, Moore–Penrose inverse (#2521).
658 Thanks @HanchaiN.
659- Optimize function `det` for integers by switching to the Bareiss algorithm:
660 no more round-off errors for integer input (#2516). Thanks @HanchaiN.
661- Implement #2463: allow negative integer powers of invertible square matrices
662 (#2517). Thanks @HanchaiN.
663- Implement the `lgamma` function (defined as log(gamma(z))) for number and
664 Complex types. Supersedes #320. (#2417). Thanks @yifanwww.
665- Fix #2523: update to the latest complex.js to improve `sin(z)` for small
666 `im(z)` (#2525). Thanks @gwhitney.
667- Fix #2526: update TypeScript definition of `ceil` (#2531). Thanks @simlaticak
668- Change mocha reporter to 'dot' to avoid excessively long log files. (#2520)
669
670# 2022-04-08, version 10.4.3
671
672- Fix #2508: improve the precision of stirlingS2 (#2509). Thanks @gwhitney.
673- Fix #2514: implement optional argument `base` in the number implementation
674 of function `log` (#2515). Thanks @gwhitney.
675- Improve the documentation on operator `;` (#2512). Thanks @gwhitney.
676
677# 2022-03-29, version 10.4.2
678
679- Fix #2499: different behavior for unit conversion "degC" and "K" (#2501).
680 Also disables getting the sign for units with an offset, which is ambiguous.
681 Thanks @gwhitney.
682- Fix #2503: fix an issue in `log()` for complex numbers in which the imaginary
683 part is much larger in absolute value than the real part, fixed in
684 `complex.js@2.1.0` (#2505), thanks @gwhitney, @infusion.
685- Fix #2493: unclear error message when an entity that is not a function
686 is being called as a function (#2494). Thanks @gwhitney.
687- Some fixes in the docs on units (#2498). Thanks @dvd101x.
688- Add `forEach` example in embedded docs (#2507). Thanks @dvd101x.
689- Correct approx.deepEqual() to accept an epsilon argument giving the
690 comparison tolerance. It was already being called this way, but was
691 silently ignoring the tolerance. Thanks @yifanwww.
692
693# 2022-03-23, version 10.4.1
694
695- Improve TypeScript definitions for function `unit` (#2479).
696 Thanks @SinanAkkoyun.
697- Add tests for type declarations (#2448). Thanks @samestep.
698- Further improvement to TypeScript definitions of `std` and `variance`
699 (make dimension parameter optional, #2474). Thanks @NattapongSiri.
700- Next step (as per #2431) for full publication of "is" functions like
701 `isMatrix` etc: Provide TypeScript definitions of "is" functions and
702 make them type guards. (#2432). Thanks @ChristopherChudzicki.
703- Fix #2491: Multi line object expressions don't work with comments (#2492).
704 Thanks @gwhitney.
705- Fix #2478: a bug in calculating the eigenvectors when dealing with complex
706 numbers (#2496). Thanks @gwhitney.
707- Update project dependencies and devDependencies.
708
709# 2022-03-07, version 10.4.0
710
711- Fix #2461: make sure `simplifyCore` recurses over all binary nodes (#2462).
712 Thanks @gwhitney.
713- Fix #2429: fix the TypeScript definitions of functions `std` and `variance`
714 (#2455). Thanks @NattapongSiri.
715- Fix #1633: implement a `cumsum` function generating cumulative sums of a list
716 of values or a matrix. (#1870). Thanks @hjonasson.
717- Upgrade to the latest version of `Fraction.js`, having more strict input,
718 only accepting an integer numerator and denominator. See #2427.
719- Fix typo in documentation example for `format`. (#2468) Thanks @abranhe.
720- Write unit tests for all jsdoc examples. See #2452. Thanks @gwhitney.
721
722# 2021-03-02, version 10.3.0
723
724- Fix #1260: implement function `symbolicEqual` (#2424). Thanks @gwhitney.
725- Fix #2441, #2442: support passing a function as argument to functions created
726 in the expression parser (#2443). Thanks @gwhitney.
727- Fix #2325: improve documentation of subset indices (#2446). Thanks @gwhitney.
728- Fix #2439: fix a bug in `complexEigs` in which real-valued norms were
729 inadvertently being typed as complex numbers (#2445). Thanks @gwhitney.
730- Fix #2436: improve documentation and error message of function `map` (#2457).
731 Thanks @gwhitney.
732
733# 2022-03-01, version 10.2.0
734
735- Implemented context options to control simplifications allowed in `simplify`,
736 see #2399, #2391. Thanks @gwhitney.
737- Implemented function `leafCount` as a first simple measure of the complexity
738 of an expression, see #2411, #2389. Thanks @gwhitney.
739- Fix #2413: improve `combinations` to return an integer result without rounding
740 errors for larger values, see #2414. Thanks @gwhitney.
741- Fix #2385: function `rotate` missing in TypeScript definitions.
742 Thanks @DIVYA-19.
743- Fix #2450: Add BigNumber to parameter type in `math.unit` and add TypeScript
744 types for `Unit.simplify` and `Unit.units` (#2353). Thanks @joshhansen.
745- Fix #2383: detect infinite loops in `simplify` (#2405). Thanks @gwhitney.
746- Fix #1423: collect like factors and cancel like terms in sums (#2388).
747 Thanks @gwhitney.
748
749# 2022-02-02, version 10.1.1
750
751- Improvements and fixes in function `simplify`, thanks @gwhitney:
752 - Fix #2393: regression bug in `simplify('2-(x+1)')`.
753 - Ad option `consoleDebug` to `simplify` to see what is going on.
754- Fix TypeScript definition of `ConfigOptions`, which was missing option
755 `predictable`.
756
757# 2022-01-15, version 10.1.0
758
759- Implemented function `invmod`, see #2368, #1744. Thanks @thetazero.
760- Improvements and fixes in function `simplify`, thanks @gwhitney:
761 - Fix #1179, #1290: improve collection of non-constant like terms (#2384).
762 - Fix #2152: do not transform strings into numbers (#2372).
763 - Fix #1913: implement support for array and object simplification (#2382).
764- Fix #2379: add embedded documentation for function `print`.
765- Remove broken example from the embedded documentation of function `forEach`.
766
767# 2021-12-29, version 10.0.2
768
769- Fix #2156: simplify expressions like `-1 / (-x)` to `1/x`. Thanks @ony3000.
770- Fix #2363: remove a redundant part of the regex to split a number.
771- Fix #2291: add support for fractions in function `intersect`.
772 Thanks @thetazero.
773- Fix #2358: bug in `SparseMatrix` when replacing a subset of a matrix with
774 a non-consecutive index. Thanks @Al-0.
775
776# 2021-12-22, version 10.0.1
777
778- Fix #1681: function `gamma` giving inaccurate complex results in some cases.
779 Thanks @kmdrGroch.
780- Fixed a typo in an example, see #2366. Thanks @blackwindforce.
781
782# 2021-11-03, version 10.0.0
783
784!!! BE CAREFUL: BREAKING CHANGES IN THE TYPESCRIPT DEFINITIONS !!!
785
786- Improvements to the Typescript typings (commit fc5c202e).
787 Thanks @joshhansen. First introduced in v9.5.1, but reverted because
788 it contains breaking changes.
789
790 Breaking changes: interface `MathNode` is now renamed to `MathNodeCommon`
791 and the related interfaces are structured in a different way.
792
793- Fixed a typo in the TypeScript definition of toHTML. Thanks @TheToto.
794
795# 2021-11-03, version 9.5.2`
796
797- Revert the improvements to the Typescript typings because they contain
798 breaking changes. The improvements will be published in v10.0.0. See #2339.
799
800# 2021-10-13, version 9.5.1
801
802- Various improvements to the Typescript typings.
803 Thanks @joshhansen and @DianaTdr.
804
805# 2021-09-22, version 9.5.0
806
807- Implemented support for calculations with percentage, see #2303.
808 Thanks @rvramesh.
809- Fix #2319: make the API of `Parser.evaluate` consistent with `math.evaluate`:
810 support a list with expressions as input.
811- Improved documentation of function `setCartesian`. Thanks @fieldfoxWim.
812
813# 2021-09-15, version 9.4.5
814
815- Improved the performance of `Node.equals` by improving the internal
816 function `deepStrictEqual`. Thanks @tomlarkworthy.
817- Fixes in the TypeScript definitions:
818 - Define `hasNumericValue`. Thanks @write2kcl.
819 - Define `MathNode.isRelationalNode`. Thanks @m93a.
820 - Fix typo in `MathNode.isConditionalNode`. Thanks @m93a.
821
822# 2021-07-07, version 9.4.4
823
824- Fixed `ArrayNode.toTex()`: remove the row delimiter on the last row,
825 see #2267. Thanks @davidtranhq.
826- Fix #2269: `intersect` not returning `null` for matrix input. Thanks @m93a.
827- Fix #2245: mathjs not working in IE11 anymore due to a missing polyfill for
828 `Symbol`. The browser bundle now includes the necessary polyfills (it is
829 larger now because of that, see also #2266). Thanks @m93a.
830- Update dependencies (`complex.js@2.0.15`, `decimal.js@10.3.1`)
831- Drop official support for node.js 10, which has reached end of life.
832 See #2258.
833
834# 2021-06-23, version 9.4.3
835
836- Fix #2222: mathjs polluting the `Decimal` prototype. Thanks @m93a.
837- Fix #2253: expression parser throwing an error when accessing nested object
838 properties named `e`.
839- Fixes in the TypeScript definitions:
840 - function `floor`, #2159, #2246. Thanks @write2kcl.
841 - function `simplify`, see #2252. Thanks @nitroin.
842- Upgraded to `decimal.js@10.3.0`
843
844# 2021-06-05, version 9.4.2
845
846- Implemented iterative eigenvalue finder for `eigs`, making it much more
847 robust. See #2179, #2237. Thanks @m93a.
848- Improved TypeScript definitions of function `parse`. Thanks @OpportunityLiu.
849
850# 2021-05-24, version 9.4.1
851
852- Fix #2100: add TypeScript declaration for `eigs`. Thanks @andrebianchessi.
853- Fix #2220: add TypeScript files to published npm package. Thanks @dhritzkiv.
854- Update readme regarding TypeScript definition files. Thanks @dhritzkiv.
855- Update to `fraction.js@4.1.1`
856
857# 2021-05-16, version 9.4.0
858
859- Implemented support to use objects with a `Map` interface as scope,
860 see #2143, #2166. Thanks @jhugman.
861- Extend `eigs` to support general complex matrices, see #1741. Thanks @m93a.
862- DenseMatrix and SparseMatrix are now iterable, see #1184. Thanks @m93a.
863- Implemented utility functions `matrixFromRows`, `matrixFromColumns`, and
864 `matrixFromFunction`, see #2155, #2153. Thanks @m93a.
865- Added TypeScript definitions to the project, making it redundant to install
866 `@types/mathjs`, and making it easier to improve the definitions. See #2187,
867 #2192. Thanks @CatsMiaow.
868- Upgraded dependencies
869 - `complex.js@2.0.13` (fixing #2211). Thanks @infusion
870 - `fraction.js@4.1.0` (`pow` now supporting rational exponents).
871- Fix #2174: function `pickRandom` having no name. Thanks @HK-SHAO.
872- Fix #2019: VSCode auto import keeps adding import { null } from 'mathjs'.
873- Fix #2185: Fix TypeScript definition of unit division, which can also return
874 a number.
875- Fix #2123: add type definitions for functions `row` and `column`.
876- Fix some files not exposed in the package, see #2213. Thanks @javiermarinros.
877
878# 2021-04-12, version 9.3.2
879
880- Fix #2169: mathjs requesting `@babel/runtime` dependency.
881 Regression introduced in `v9.3.1`.
882
883# 2021-04-10, version 9.3.1
884
885- Fix #2133: strongly improved the performance of `isPrime`, see #2139.
886 Thanks @Yaffle.
887- Fix #2150: give a clear error "Error: Undefined function ..." instead when
888 evaluating a non-existing function.
889- Fix #660: expose internal functions `FunctionNode.onUndefinedFunction(name)`
890 and `SymbolNode.onUndefinedSymbol(name)`, allowing to override the behavior.
891 By default, an Error is thrown.
892
893# 2021-03-10, version 9.3.0
894
895- Implemented support for parsing non decimal numbers with radix point,
896 see #2122, #2121. Thanks @clnhlzmn.
897- Fix #2128: typo in docs of `luSolveAll` and `usolveAll`.
898
899# 2021-02-03, version 9.2.0
900
901- Implemented function `count` to count the total elements in a matrix,
902 see #2085. Thanks @Josef37.
903- Fix #2096: cleanup old reference to external dependency `crypto`.
904- Some refactoring in the code to remove duplications, see #2093.
905 Thanks @Josef37.
906
907# 2021-01-27, version 9.1.0
908
909- Extended function `reshape` with support for a wildcard `-1` to automatically
910 calculate the remaining size, like `reshape([1, 2, 3, 4, 5, 6], [-1, 2])`
911 which will output `[[0, 1], [2, 3], [4, 5]]`. See #2075. Thanks @Josef37.
912- Fix #2087: function `simplify` ignores second argument of `log`, for example
913 in `simplify('log(e, 9)')` . Thanks @quentintruong.
914
915# 2021-01-16, version 9.0.0
916
917- Improved support for bin, hex, and oct literals. See #1996. Thanks @clnhlzmn.
918 - **Breaking change**: parse literals with prefixes `0b`, `0c`, and `0x` are
919 now unsigned by default. To parse them as signed, you have to specify a
920 suffix specifying the word size such as `i16` or `i32`.
921 - Function `format` now supports more notations: `bin`, 'hex', and `oct`,
922 for example `format(255, {notation: "hex"})`.
923 - The functions `format`, `bin`, `hex`, `oct` now allow specifying a wordSize,
924 like `bin(10, 32)` and `format(10, {notation: "bin", wordSize: 32})`.
925 - BigNumber support for the bin, hex, and oct literals.
926- Extended and improved the example rocket_trajectory_optimization.html.
927 Thanks @Josef37.
928
929# 2020-12-30, version 8.1.1
930
931- Improved the performance of parsing and evaluating units a lot, see #2065.
932 Thanks @flaviut.
933- Upgraded dependency `fraction.js` to `v4.0.13`.
934- Moved continuous integration testing from Travis CI to Github Workflow,
935 see #2024, #2041. Thanks @harrysarson.
936
937# 2020-12-04, version 8.1.0
938
939- Implemented units `kilogramforce` (`kgf`). Thanks @rnd-debug.
940- Fix #2026: Implement a new option `fractionsLimit` for function `simplify`,
941 defaulting to `Infinity`.
942- Improved the documentation of function `clone`. Thanks @redbar0n.
943
944# 2020-11-09, version 8.0.1
945
946- Fix #1979: missing "subset" dependency when using "mathjs/number" entry point.
947- Fix #2022: update pretty printing with MathJax example to the latest version
948 of MathJax. Thanks @pkra.
949
950# 2020-11-06, version 8.0.0
951
952!!! BE CAREFUL: BREAKING CHANGES !!!
953
954- You can now use mathjs directly in node.js using ES modules without need for
955 a transpiler (see #1928, #1941, #1962).
956 Automatically loading either commonjs code or ES modules code is improved.
957 All generated code is moved under `/lib`: the browser bundle is moved from
958 `/dist` to `/lib/browser`, ES module files are moved to `/lib/esm`,
959 and commonjs files are moved to `/lib/cjs`. Thanks @GreenImp.
960- Non-minified bundle `dist/math.js` is no longer provided. Either use the
961 minified bundle, or create a bundle yourself.
962- Replaced random library `seed-random` with `seedrandom`, see #1955.
963 Thanks @poppinlp.
964- Breaking changes in `pickRandom`, see #1990, #1976.
965 - Will no longer return the input matrix when the given number is greater
966 than the length of the provided possibles. Instead, the function always
967 returns results with the requested number of picks.
968 - Will now return a `Matrix` as output when input was a `Matrix`.
969 - Introduced a new syntax:
970
971 ```
972 math.pickRandom(array, { weights, number, elementWise })
973 ```
974
975 - Introduced a new option `elementWise`, which is `true` by default.
976 When setting `elementWise` to false, an array containing arrays will return
977 random pick of arrays instead of the elements inside of the nested arrays.
978
979# 2020-11-02, version 7.6.0
980
981- Implemented function `rotate(w, theta)`. See #1992, #1160. Thanks @rnd-debug.
982- Implemented support for custom characters in Units via `Unit.isValidAlpha`.
983 See #1663, #2000. Thanks @rnd-debug.
984
985# 2020-10-10, version 7.5.1
986
987- Fix object pollution vulnerability in `math.config`. Thanks Snyk.
988
989# 2020-10-07, version 7.5.0
990
991- Function `pickRandom` now allows randomly picking elements from matrices
992 with 2 or more dimensions instead of only from a vector, see #1974.
993 Thanks @KonradLinkowski.
994
995# 2020-10-07, version 7.4.0
996
997- Implemented support for passing a precision in functions `ceil`, `floor`,
998 and `fix`, similar to `round`, see #1967, #1901. Thanks @rnd-debug.
999- Implemented function `rotationMatrix`, see #1160, #1984. Thanks @rnd-debug.
1000- Implement a clear error message when using `sqrtm` with a matrix having
1001 more than two dimensions. Thanks @KonradLinkowski.
1002- Update dependency `decimal.js` to `10.2.1`.
1003
1004# 2020-09-26, version 7.3.0
1005
1006- Implemented functions `usolveAll` and `lsolveAll`, see #1916. Thanks @m93a.
1007- Implemented support for units in functions `std` and `variance`, see #1950.
1008 Thanks @rnd-debug.
1009- Implemented support for binary, octal, and hexadecimal notation in the
1010 expression parser, and implemented functions `bin`, `oct`, and `hex` for
1011 formatting. Thanks @clnhlzmn.
1012- Fix #1964: inconsistent calculation of negative dividend modulo for
1013 `BigNumber` and `Fraction`. Thanks @ovk.
1014
1015# 2020-08-24, version 7.2.0
1016
1017- Implemented new function `diff`, see #1634, #1920. Thanks @Veeloxfire.
1018- Implemented support for norm 2 for matrices in function `norm`.
1019 Thanks @rnd-debug.
1020
1021# 2020-07-13, version 7.1.0
1022
1023- Implement support for recursion (self-referencing) of typed-functions,
1024 new in `typed-function@2.0.0`. This fixes #1885: functions which where
1025 extended with a new data type did not always work. Thanks @nickewing.
1026- Fix #1899: documentation on expression trees still using old namespace
1027 `math.expression.node.*` instead of `math.*`.
1028
1029# 2020-06-24, version 7.0.2
1030
1031- Fix #1882: have `DenseMatrix.resize` and `SparseMatrix.resize` accept
1032 `DenseMatrix` and `SparseMatrix` as inputs too, not only `Array`.
1033- Fix functions `sum`, `prod`, `min`, and `max` not throwing a conversion error
1034 when passing a single string, like `sum("abc")`.
1035
1036# 2020-05-30, version 7.0.1
1037
1038- Fix #1844: clarify the documentation of function `eigs`. Thanks @Lazersmoke.
1039- Fix #1855: Fix error in the documentation for `math.nthRoots(x)`.
1040- Fix #1856: make the library robust against Object prototype pollution.
1041
1042# 2020-05-07, version 7.0.0
1043
1044Breaking changes:
1045
1046- Improvements in calculation of the `dot` product of complex values.
1047 The first argument is now conjugated. See #1761. Thanks @m93a.
1048- Dropped official support for Node.js v8 which has reached end of life.
1049- Removed all deprecation warnings introduced in v6.
1050 To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first
1051 and resolve all deprecation warnings.
1052
1053# 2020-05-04, version 6.6.5
1054
1055- Fix #1834: value `Infinity` cannot be serialized and deserialized.
1056 This is solved now with a new `math.replacer` function used as
1057 `JSON.stringify(value, math.replacer)`.
1058- Fix #1842: value `Infinity` not turned into the latex symbol `\\infty`.
1059
1060# 2020-04-15, version 6.6.4
1061
1062- Fix published files containing Windows line endings (CRLF instead of LF).
1063
1064# 2020-04-10, version 6.6.3
1065
1066- Fix #1813: bug in engineering notation for numbers of function `format`,
1067 sometimes resulting in needless trailing zeros.
1068- Fix #1808: methods `.toNumber()` and `.toNumeric()` not working on a
1069 unitless unit.
1070- Fix #1645: not being able to use named operators `mod`, `and`, `not`, `or`,
1071 `xor`, `to`, `in` as object keys. Thanks @Veeloxfire.
1072- Fix `eigs` not using `config.epsilon`.
1073
1074# 2020-03-29, version 6.6.2
1075
1076- Fix #1789: Function `eigs` not calculating with BigNumber precision
1077 when input contains BigNumbers.
1078- Run the build script during npm `prepare`, so you can use the library
1079 directly when installing directly from git. See #1751. Thanks @cinderblock.
1080
1081# 2020-02-26, version 6.6.1
1082
1083- Fix #1725: simplify `a/(b/c)`. Thanks @dbramwell.
1084- Fix examples in documentation of `row` and `column`.
1085
1086# 2020-02-01, version 6.6.0
1087
1088- Implemented function `eigs`, see #1705, #542 #1175. Thanks @arkajitmandal.
1089- Fixed #1727: validate matrix size when creating a `DenseMatrix` using
1090 `fromJSON`.
1091- Fixed `DenseMatrix.map` copying the size and datatype from the original
1092 matrix instead of checking the returned dimensions and type of the callback.
1093- Add a caret to dependencies (like) `^1.2.3`) to allow downstream updates
1094 without having to await a new release of mathjs.
1095
1096# 2020-01-08, version 6.5.0
1097
1098- Implemented `baseName` option for `createUnit`, see #1707.
1099 Thanks @ericman314.
1100
1101# 2020-01-06, version 6.4.0
1102
1103- Extended function `dimension` with support for n-dimensional points.
1104 Thanks @Veeloxfire.
1105
1106# 2019-12-31, version 6.3.0
1107
1108- Improved performance of `factorial` for `BigNumber` up to a factor two,
1109 see #1687. Thanks @kmdrGroch.
1110
1111# 2019-11-20, version 6.2.5
1112
1113- Fixed `IndexNode` using a hardcoded, one-based implementation of `index`,
1114 making it impossible to instantiate a zero-based version of the expression
1115 parser. See #782.
1116
1117# 2019-11-20, version 6.2.4
1118
1119- Fixed #1669: function 'qr' threw an error if the pivot was zero,
1120 thanks @kevinkelleher12 and @harrysarson.
1121- Resolves #942: remove misleading assert in 'qr'. Thanks @harrysarson.
1122- Work around a bug in complex.js where `sign(0)` returns complex NaN.
1123 Thanks @harrysarson.
1124
1125# 2019-10-06, version 6.2.3
1126
1127- Fixed #1640: function `mean` not working for units. Thanks @clintonc.
1128- Fixed #1639: function `min` listed twice in the "See also" section of the
1129 embedded docs of function `std`.
1130- Improved performance of `isPrime`, see #1641. Thanks @arguiot.
1131
1132# 2019-09-23, version 6.2.2
1133
1134- Fixed methods `map` and `clone` not copying the `dotNotation` property of
1135 `IndexNode`. Thanks @rianmcguire.
1136- Fixed a typo in the documentation of `toHTML`. Thanks @maytanthegeek.
1137- Fixed #1615: error in the docs of `isNumeric`.
1138- Fixed #1628: Cannot call methods on empty strings or numbers with value `0`.
1139
1140# 2019-08-31, version 6.2.1
1141
1142- Fixed #1606: function `format` not working for expressions.
1143
1144# 2019-08-28, version 6.2.0
1145
1146- Improved performance of `combinationsWithRep`. Thanks @waseemyusuf.
1147- Add unit aliases `bit` and `byte`.
1148- Fix docs referring to `bit` and `byte` instead of `bits` and `bytes`.
1149- Updated dependency `typed-function@1.1.1`.
1150
1151# 2019-08-17, version 6.1.0
1152
1153- Implemented function `combinationsWithRep` (see #1329). Thanks @waseemyusuf.
1154
1155# 2019-08-05, version 6.0.4
1156
1157- Fixed #1554, #1565: ES Modules where not transpiled to ES5, giving issues on
1158 old browsers. Thanks @mockdeep for helping to find a solution.
1159
1160# 2019-07-07, version 6.0.3
1161
1162- Add `unpkg` and `jsdelivr` fields in package.json pointing to UMD build.
1163 Thanks @tmcw.
1164- Fix #1550: nested user defined function not receiving variables of an
1165 outer user defined function.
1166
1167# 2019-06-11, version 6.0.2
1168
1169- Fix not being able to set configuration after disabling function `import`
1170 (regression since v6.0.0).
1171
1172# 2019-06-09, version 6.0.1
1173
1174- Fix function reference not published in npm library.
1175- Fix function `evaluate` and `parse` missing in generated docs.
1176
1177# 2019-06-08, version 6.0.0
1178
1179!!! BE CAREFUL: BREAKING CHANGES !!!
1180
1181### Most notable changes
1182
11831. Full support for **ES modules**. Support for tree-shaking out of the box.
1184
1185 Load all functions:
1186
1187 ```js
1188 import * as math from 'mathjs'
1189 ```
1190
1191 Use a few functions:
1192
1193 ```js
1194 import { add, multiply } from 'mathjs'
1195 ```
1196
1197 Load all functions with custom configuration:
1198
1199 ```js
1200 import { create, all } from 'mathjs'
1201 const config = { number: 'BigNumber' }
1202 const math = create(all, config)
1203 ```
1204
1205 Load a few functions with custom configuration:
1206
1207 ```js
1208 import { create, addDependencies, multiplyDependencies } from 'mathjs'
1209 const config = { number: 'BigNumber' }
1210 const { add, multiply } = create({
1211 addDependencies,
1212 multiplyDependencies
1213 }, config)
1214 ```
1215
12162. Support for **lightweight, number-only** implementations of all functions:
1217
1218 ```
1219 import { add, multiply } from 'mathjs/number'
1220 ```
1221
12223. New **dependency injection** solution used under the hood.
1223
1224### Breaking changes
1225
1226- Node 6 is no longer supported.
1227
1228- Functions `config` and `import` are not available anymore in the global
1229 context:
1230
1231 ```js
1232 // v5
1233 import * as mathjs from 'mathjs'
1234 mathjs.config(...) // error in v6.0.0
1235 mathjs.import(...) // error in v6.0.0
1236 ```
1237
1238 Instead, create your own mathjs instance and pass config and imports
1239 there:
1240
1241 ```js
1242 // v6
1243 import { create, all } from 'mathjs'
1244 const config = { number: 'BigNumber' }
1245 const mathjs = create(all, config)
1246 mathjs.import(...)
1247 ```
1248
1249- Renamed function `typeof` to `typeOf`, `var` to `variance`,
1250 and `eval` to `evaluate`. (the old function names are reserved keywords
1251 which can not be used as a variable name).
1252- Deprecated the `Matrix.storage` function. Use `math.matrix` instead to create
1253 a matrix.
1254- Deprecated function `math.expression.parse`, use `math.parse` instead.
1255 Was used before for example to customize supported characters by replacing
1256 `math.parse.isAlpha`.
1257- Moved all classes like `math.type.Unit` and `math.expression.Parser` to
1258 `math.Unit` and `math.Parser` respectively.
1259- Fixed #1428: transform iterating over replaced nodes. New behavior
1260 is that it stops iterating when a node is replaced.
1261- Dropped support for renaming factory functions when importing them.
1262- Dropped fake BigNumber support of function `erf`.
1263- Removed all index.js files used to load specific functions instead of all, like:
1264
1265 ```
1266 // v5
1267 // ... set up empty instance of mathjs, then load a set of functions:
1268 math.import(require('mathjs/lib/function/arithmetic'))
1269 ```
1270
1271 Individual functions are now loaded simply like:
1272
1273 ```js
1274 // v6
1275 import { add, multiply } from 'mathjs'
1276 ```
1277
1278 To set a specific configuration on the functions:
1279
1280 ```js
1281 // v6
1282 import { create, addDependencies, multiplyDependencies } from 'mathjs'
1283 const config = { number: 'BigNumber' }
1284 const math = create({ addDependencies, multiplyDependencies }, config)
1285 ```
1286
1287 See example `advanced/custom_loading.js`.
1288
1289- Updated the values of all physical units to their latest official values.
1290 See #1529. Thanks @ericman314.
1291
1292### Non breaking changes
1293
1294- Implemented units `t`, `tonne`, `bel`, `decibel`, `dB`, and prefixes
1295 for `candela`. Thanks @mcvladthegoat.
1296- Fixed `epsilon` setting being applied globally to Complex numbers.
1297- Fix `math.simplify('add(2, 3)')` throwing an error.
1298- Fix #1530: number formatting first applied `lowerExp` and `upperExp`
1299 and after that rounded the value instead of the other way around.
1300- Fix #1473: remove `'use strict'` in every file, not needed anymore.
1301
1302# 2019-05-18, version 5.10.3
1303
1304- Fixed dependency `del` being a dependency instead of devDependency.
1305
1306# 2019-05-18, version 5.10.2
1307
1308- Fix #1515, #1516, #1517: broken package due to a naming conflict in
1309 the build folder of a util file `typeOf.js` and `typeof.js`.
1310 Solved by properly cleaning all build folders before building.
1311
1312# 2019-05-17, version 5.10.1
1313
1314- Fix #1512: format using notation `engineering` can give wrong results
1315 when the value has less significant digits than the number of digits in
1316 the output.
1317
1318# 2019-05-08, version 5.10.0
1319
1320- Fix `lib/header.js` not having filled in date and version. Thanks @kevjin.
1321- Upgraded dependency `decimal.js@10.2.0`, fixing an issue on node.js 12.
1322
1323# 2019-04-08, version 5.9.0
1324
1325- Implemented functions `row` and `column` (see #1413). Thanks @SzechuanSage.
1326- Fixed #1459: `engineering` notation of function `format` not available
1327 for `BigNumber`.
1328- Fixed #1465: `node.toHTML()` not correct for unary operators like
1329 `factorial`.
1330
1331# 2019-03-20, version 5.8.0
1332
1333- Implemented new function `apply`. Thanks @bnlcas.
1334- Implemented passing an optional `dimension` argument to `std` and `var`.
1335 Thanks @bnlcas.
1336
1337# 2019-03-10, version 5.7.0
1338
1339- Implemented support for `pow()` in `derivative`. Thanks @sam-19.
1340- Gracefully handle round-off errors in fix, ceil, floor, and range
1341 (Fixes #1429, see also #1434, #1432). Thanks @ericman314.
1342
1343# 2019-03-02, version 5.6.0
1344
1345- Upgrade decimal.js to v10.1.1 (#1421).
1346- Fixed #1418: missing whitespace when stringifying an expression
1347 containing "not".
1348
1349# 2019-02-20, version 5.5.0
1350
1351- Fixed #1401: methods `map` and `forEach` of `SparseMatrix` not working
1352 correctly when indexes are unordered.
1353- Fixed #1404: inconsistent rounding of negative numbers.
1354- Upgrade tiny-emitter to v2.1.0 (#1397).
1355
1356# 2019-01-25, version 5.4.2
1357
1358- Fixed `math.format` not working for BigNumbers with a precision above
1359 1025 digits (see #1385). Thanks @ericman314.
1360- Fixed incorrect LaTeX output of `RelationalNode`. Thanks @rianmcguire.
1361- Fixed a bug the methods `map`, `forEach`, `traverse`, and `transform`
1362 of `FunctionNode`.
1363
1364# 2019-01-10, version 5.4.1
1365
1366- Fix #1378: negative bignumbers not formatted correctly.
1367- Upgrade fraction.js to version 4.0.12 (#1369).
1368
1369# 2018-12-09, version 5.4.0
1370
1371- Extended sum.js to accept a dimension input to calculate the sum over a
1372 specific axis. Thanks @bnlcas.
1373- Fix #1328: objects can't be written multi-line. Thanks @GHolk.
1374- Remove side effects caused by `Unit.format` and `Unit.toString`,
1375 making changes to the unit on execution. Thanks @ericman314.
1376
1377# 2018-12-03, version 5.3.1
1378
1379- Fixed #1336: Unit.toSI() returning units with prefix like `mm` instead
1380 of `m`. Thanks @ericman314.
1381
1382# 2018-11-29, version 5.3.0
1383
1384- Implemented function `hasNumericValue`. Thanks @Sathish-kumar-Subramani.
1385- Fix #1326: non-ascii character in print.js.
1386- Fix #1337: `math.format` not working correctly with `{ precision: 0 }`.
1387 Thanks @dkenul.
1388
1389# 2018-10-30, version 5.2.3
1390
1391- Fixed #1293: non-unicode characters in `escape-latex` giving issues in some
1392 specific cases. Thanks @dangmai.
1393- Fixed incorrect LaTeX output of function `bitNot`, see #1299. Thanks @FSMaxB.
1394- Fixed #1304: function `pow` not supporting inputs `pow(Unit, BigNumber)`.
1395- Upgraded dependencies (`escape-latex@1.2.0`)
1396
1397# 2018-10-23, version 5.2.2
1398
1399- Fixed #1286: Fixed unit base recognition and formatting for
1400 user-defined units. Thanks @ericman314.
1401
1402# 2018-10-18, version 5.2.1
1403
1404- Fixed unit `rod` being defined as `5.02921` instead of `5.0292`.
1405 Thanks @ericman314.
1406- Upgraded dependencies (`fraction.js@4.0.10`)
1407- Upgraded devDependencies (`@babel/core@7.1.2`, `nyc@13.1.0`,
1408 `webpack@4.21.0`).
1409
1410# 2018-10-05, version 5.2.0
1411
1412- Implemented support for chained conditionals like `10 < x <= 50`.
1413 Thanks @ericman314.
1414- Add an example showing a proof of concept of using `BigInt` in mathjs.
1415- Fixed #1269: Bugfix for BigNumber divided by unit. Thanks @ericman314.
1416- Fixed #1240: allow units having just a value and no unit.
1417 Thanks @ericman314.
1418
1419## 2018-09-09, version 5.1.2
1420
1421- Fixed a typo in the docs of `parse`. Thanks @mathiasvr.
1422- Fixed #1222: a typo in the docs of `subset`.
1423- Fixed #1236: `quantileSeq` has inconsistent return.
1424- Fixed #1237: norm sometimes returning a complex number instead of
1425 number.
1426- Upgraded dependencies (`fraction.js@4.0.9`)
1427- Upgraded devDependencies (`babel@7`, `karma-webpack@3.0.4`,
1428 `nyc@13.0.1`, `standard@12.0.0`, `uglify-js@3.4.9`, `webpack@4.17.2`)
1429
1430## 2018-08-21, version 5.1.1
1431
1432- Function `isNumeric` now recognizes more types.
1433- Fixed #1214: functions `sqrt`, `max`, `min`, `var`, `std`, `mode`, `mad`,
1434 `median`, and `partitionSelect` not neatly handling `NaN` inputs. In some
1435 cases (`median`, `mad`, and `partitionSelect`) this resulted in an infinite
1436 loop.
1437- Upgraded dependencies (`escape-latex@1.1.1`)
1438- Upgraded devDependencies (`webpack@4.17.0`)
1439
1440## 2018-08-12, version 5.1.0
1441
1442- Implemented support for strings enclosed in single quotes.
1443 Thanks @jean-emmanuel.
1444- Implemented function `getMatrixDataType`. Thanks @JasonShin.
1445- Implemented new `options` argument in `simplify`. Thanks @paulobuchsbaum.
1446- Bug fixes in `rationalize`, see #1173. Thanks @paulobuchsbaum.
1447
1448## 2018-07-22, version 5.0.4
1449
1450- Strongly improved the performance of functions `factorial` for numbers.
1451 This improves performance of functions `gamma`, `permutation`, and
1452 `combination` too. See #1170. Thanks @honeybar.
1453- Strongly improved the performance of function `reshape`, thanks to a
1454 friend of @honeybar.
1455
1456## 2018-07-14, version 5.0.3
1457
1458- Fixed many functions (for example `add` and `subtract`) not working
1459 with matrices having a `datatype` defined.
1460- Fixed #1147: bug in `format` with `engineering` notation in outputting
1461 the correct number of significant figures. Thanks @ericman314.
1462- Fixed #1162: transform functions not being cleaned up when overriding
1463 it by importing a factory function with the same name.
1464- Fixed broken links in the documentation. Thanks @stropitek.
1465- Refactored the code of `parse` into a functional approach.
1466 Thanks @harrysarson.
1467- Changed `decimal.js` import to ES6. Thanks @weinshel.
1468
1469## 2018-07-07, version 5.0.2
1470
1471- Fixed #1136: rocket trajectory example broken (since v4.0.0).
1472- Fixed #1137: `simplify` unnecessarily replacing implicit multiplication with
1473 explicit multiplication.
1474- Fixed #1146: `rationalize` throwing exceptions for some input with decimals.
1475 Thanks @maruta.
1476- Fixed #1088: function arguments not being passed to `rawArgs` functions.
1477- Fixed advanced example `add_new_datatypes`.
1478- Fixed mathjs core constants not working without complex numbers.
1479 Thanks @ChristopherChudzicki.
1480- Fixed a broken link in the documentation on units. Thanks @stropitek.
1481- Upgraded dependencies (`typed-function@1.0.4`, `complex.js@2.0.11`).
1482- Upgraded devDependencies (`babel-loader@7.1.5`, `uglify-js@3.4.3`,
1483 `expr-eval@1.2.2`, `webpack@4.15.1`).
1484
1485## 2018-07-01, version 5.0.1
1486
1487- Improved error messaging when converting units. Thanks @gap777.
1488- Upgraded devDependencies (`kerma`, `uglify-js`, `webpack`).
1489
1490## 2018-06-16, version 5.0.0
1491
1492!!! BE CAREFUL: BREAKING CHANGES !!!
1493
1494- Implemented complex conjugate transpose `math.ctranspose`. See #1097.
1495 Thanks @jackschmidt.
1496- Changed the behavior of `A'` (transpose) in the expression parser to
1497 calculate the complex conjugate transpose. See #1097. Thanks @jackschmidt.
1498- Added support for `complex({abs: 1, arg: 1})`, and improved the docs on
1499 complex numbers. Thanks @ssaket.
1500- Renamed `eye` to `identity`, see #1054.
1501- Math.js code can now contain ES6. The ES6 source code is moved from `lib`
1502 to `src`, and `lib` now contains the compiled ES5 code.
1503- Upgraded dependencies:
1504 - `decimal.js` from `9.0.1` to `10.0.1`
1505 - Upgraded dev dependencies
1506- Changed code style to <https://standardjs.com/>, run linter on `npm test`.
1507 See #1110.
1508- Dropped support for bower. Use npm or an other package manages instead.
1509- Dropped support for (non-primitive) instances of `Number`, `Boolean`, and
1510 `String` from functions `clone` and `typeof`.
1511- Dropped official support for IE9 (probably still works, but it's not tested).
1512- Fixed #851: More consistent behavior of sqrt, nthRoot, and pow.
1513 Thanks @dakotablair.
1514- Fixed #1103: Calling `toTex` on node that contains `derivative` causing
1515 an exception. Thanks @joelhoover.
1516
1517## 2018-06-02, version 4.4.2
1518
1519- Drastically improved the performance of `det`. Thanks @ericman314.
1520- Fixed #1065, #1121: Fixed wrong documentation of function
1521 `compareNatural` and clarified the behavior for strings.
1522- Fixed #1122 a regression in function `inv` (since `v4.4.1`).
1523 Thanks @ericman314.
1524
1525## 2018-05-29, version 4.4.1
1526
1527- Fixed #1109: a bug in `inv` when dealing with values close to zero.
1528 Thanks @ericman314.
1529
1530## 2018-05-28, version 4.4.0
1531
1532- Implemented functions `equalText` and `compareText`. See #1085.
1533
1534## 2018-05-21, version 4.3.0
1535
1536- Implemented matrix exponential `math.expm`. Thanks @ericman314.
1537- Fixed #1101: math.js bundle not working when loading in a WebWorker.
1538- Upgraded dependencies
1539 - `complex.js` from `v2.0.2` to `v2.0.10`.
1540 - `fraction.js` from `v4.0.4` to `v4.0.8`.
1541- Upgraded devDependencies (`mocha`, `uglify-js`, `webpack`).
1542
1543## 2018-05-05, version 4.2.2
1544
1545- Fixed calculating the Frobenius norm of complex matrices correctly,
1546 see #1098. Thanks @jackschmidt.
1547- Fixed #1076: cannot use mathjs in React VR by updating to
1548 `escape-latex@1.0.3`.
1549
1550## 2018-05-02, version 4.2.1
1551
1552- Fixed `dist/math.js` being minified.
1553
1554## 2018-05-02, version 4.2.0
1555
1556- Implemented function `math.sqrtm`. Thanks @ferrolho.
1557- Implemented functions `math.log2`, `math.log1p`, and `math.expm1`.
1558 Thanks @BigFav and @harrysarson.
1559- Fixed some unit tests broken on nodejs v10.
1560- Upgraded development dependencies.
1561- Dropped integration testing on nodejs v4.
1562
1563## 2018-04-18, version 4.1.2
1564
1565- Fixed #1082: implemented support for unit plurals `decades`, `centuries`,
1566 and `millennia`.
1567- Fixed #1083: units `decade` and `watt` having a wrong name when stringifying.
1568 Thanks @ericman314.
1569
1570## 2018-04-11, version 4.1.1
1571
1572- Fixed #1063: derivative not working when resolving a variable with unary
1573 minus like `math.derivative('-x', 'x')`.
1574
1575## 2018-04-08, version 4.1.0
1576
1577- Extended function `math.print` with support for arrays and matrices.
1578 Thanks @jean-emmanuel.
1579- Fixed #1077: Serialization/deserialization to JSON with reviver not being
1580 supported by nodes.
1581- Fixed #1016: Extended `math.typeof` with support for `ResultSet` and nodes
1582 like `SymbolNode`.
1583- Fixed #1072: Added support for long and short prefixes for the unit `bar`
1584 (i.e. `millibar` and `mbar`).
1585
1586## 2018-03-17, version 4.0.1
1587
1588- Fixed #1062: mathjs not working on ES5 browsers like IE11 and Safari 9.3.
1589- Fixed #1061: `math.unit` not accepting input like `1/s`.
1590
1591## 2018-02-25, version 4.0.0
1592
1593!!! BE CAREFUL: BREAKING CHANGES !!!
1594
1595Breaking changes (see also #682):
1596
1597- **New expression compiler**
1598
1599 The compiler of the expression parser is replaced with one that doesn't use
1600 `eval` internally. See #1019. This means:
1601
1602 - a slightly improved performance on most browsers.
1603 - less risk of security exploits.
1604 - the code of the new compiler is easier to understand, maintain, and debug.
1605
1606 Breaking change here: When using custom nodes in the expression parser,
1607 the syntax of `_compile` has changed. This is an undocumented feature though.
1608
1609- **Parsed expressions**
1610
1611 - The class `ConstantNode` is changed such that it just holds a value
1612 instead of holding a stringified value and it's type.
1613 `ConstantNode(valueStr, valueType`) is now `ConstantNode(value)`
1614 Stringification uses `math.format`, which may result in differently
1615 formatted numeric output.
1616
1617 - The constants `true`, `false`, `null`, `undefined`, `NaN`, `Infinity`,
1618 and `uninitialized` are now parsed as ConstantNodes instead of
1619 SymbolNodes in the expression parser. See #833.
1620
1621- **Implicit multiplication**
1622
1623 - Changed the behavior of implicit multiplication to have higher
1624 precedence than explicit multiplication and division, except in
1625 a number of specific cases. This gives a more natural behavior
1626 for implicit multiplications. For example `24h / 6h` now returns `4`,
1627 whilst `1/2 kg` evaluates to `0.5 kg`. Thanks @ericman314. See: #792.
1628 Detailed documentation: <https://github.com/josdejong/mathjs/blob/v4/docs/expressions/syntax.md#implicit-multiplication>.
1629
1630 - Immediately invoking a function returned by a function like `partialAdd(2)(3)`
1631 is no longer supported, instead these expressions are evaluated as
1632 an implicit multiplication `partialAdd(2) * (3)`. See #1035.
1633
1634- **String formatting**
1635
1636 - In function `math.format`, the options `{exponential: {lower: number, upper: number}}`
1637 (where `lower` and `upper` are values) are replaced with `{lowerExp: number, upperExp: number}`
1638 (where `lowerExp` and `upperExp` are exponents). See #676. For example:
1639
1640 ```js
1641 math.format(2000, {exponential: {lower: 1e-2, upper: 1e2}})
1642 ```
1643
1644 is now:
1645
1646 ```js
1647 math.format(2000, {lowerExp: -2, upperExp: 2})
1648 ```
1649
1650 - In function `math.format`, the option `notation: 'fixed'` no longer rounds to
1651 zero digits when no precision is specified: it leaves the digits as is.
1652 See #676.
1653
1654- **String comparison**
1655
1656 Changed the behavior of relational functions (`compare`, `equal`,
1657 `equalScalar`, `larger`, `largerEq`, `smaller`, `smallerEq`, `unequal`)
1658 to compare strings by their numeric value they contain instead of
1659 alphabetically. This also impacts functions `deepEqual`, `sort`, `min`,
1660 `max`, `median`, and `partitionSelect`. Use `compareNatural` if you
1661 need to sort an array with text. See #680.
1662
1663- **Angle units**
1664
1665 Changed `rad`, `deg`, and `grad` to have short prefixes,
1666 and introduced `radian`, `degree`, and `gradian` and their plurals
1667 having long prefixes. See #749.
1668
1669- **Null**
1670
1671 - `null` is no longer implicitly casted to a number `0`, so input like
1672 `math.add(2, null)` is no longer supported. See #830, #353.
1673
1674 - Dropped constant `uninitialized`, which was used to initialize
1675 leave new entries undefined when resizing a matrix is removed.
1676 Use `undefined` instead to indicate entries that are not explicitly
1677 set. See #833.
1678
1679- **New typed-function library**
1680
1681 - The `typed-function` library used to check the input types
1682 of functions is completely rewritten and doesn't use `eval` under
1683 the hood anymore. This means a reduced security risk, and easier
1684 to debug code. The API is the same, but error messages may differ
1685 a bit. Performance is comparable but may differ in specific
1686 use cases and browsers.
1687
1688Non breaking changes:
1689
1690- Thanks to the new expression compiler and `typed-function` implementation,
1691 mathjs doesn't use JavaScript's `eval` anymore under the hood.
1692 This allows using mathjs in environments with security restrictions.
1693 See #401.
1694- Implemented additional methods `isUnary()` and `isBinary()` on
1695 `OperatorNode`. See #1025.
1696- Improved error messages for statistical functions.
1697- Upgraded devDependencies.
1698- Fixed #1014: `derivative` silently dropping additional arguments
1699 from operator nodes with more than two arguments.
1700
1701## 2018-02-07, version 3.20.2
1702
1703- Upgraded to `typed-function@0.10.7` (bug-fix release).
1704- Fixed option `implicit` not being copied from an `OperatorNode`
1705 when applying function `map`. Thanks @HarrySarson.
1706- Fixed #995: spaces and underscores not property being escaped
1707 in `toTex()`. Thanks @FSMaxB.
1708
1709## 2018-01-17, version 3.20.1
1710
1711- Fixed #1018: `simplifyCore` failing in some cases with parentheses.
1712 Thanks @firepick1.
1713
1714## 2018-01-14, version 3.20.0
1715
1716- Implement support for 3 or more arguments for operators `+` and `*` in
1717 `derivative`. Thanks @HarrySarson. See #1002.
1718- Fixed `simplify` evalution of `simplify` of functions with more than two
1719 arguments wrongly: `simplify('f(x, y, z)') evaluated to`f(f(x, y), z)`
1720 instead of `f(x, y, z)`. Thanks @joelhoover.
1721- Fixed `simplify` throwing an error in some cases when simplifying unknown
1722 functions, for example `simplify('f(4)')`. Thanks @joelhoover.
1723- Fixed #1013: `simplify` wrongly simplifing some expressions containing unary
1724 minus, like `0 - -x`. Thanks @joelhoover.
1725- Fixed an error in an example in the documentation of `xor`. Thanks @denisx.
1726
1727## 2018-01-06, version 3.19.0
1728
1729- Extended functions `distance` and `intersect` with support for BigNumbers.
1730 Thanks @ovk.
1731- Improvements in function `simplify`: added a rule that allows combining
1732 of like terms in embedded quantities. Thanks @joelhoover.
1733
1734## 2017-12-28, version 3.18.1
1735
1736- Fixed #998: An issue with simplifying an expression containing a subtraction.
1737 Thanks @firepick1.
1738
1739## 2017-12-16, version 3.18.0
1740
1741- Implemented function `rationalize`. Thanks @paulobuchsbaum.
1742- Upgraded dependencies:
1743
1744 ```
1745 decimal.js 7.2.3 → 9.0.1 (no breaking changes affecting mathjs)
1746 fraction.js 4.0.2 → 4.0.4
1747 tiny-emitter 2.0.0 → 2.0.2
1748 ```
1749
1750- Upgraded dev dependencies.
1751- Fixed #975: a wrong example in the docs of lusolve.
1752- Fixed #983: `pickRandom` returning an array instead of single value
1753 when input was an array with just one value. Clarified docs.
1754- Fixed #969: preven issues with yarn autoclean by renaming an
1755 interally used folder "docs" to "embeddedDocs".
1756
1757## 2017-11-18, version 3.17.0
1758
1759- Improved `simplify` for nested exponentiations. Thanks @IvanVergiliev.
1760- Fixed a security issue in `typed-function` allowing arbitrary code execution
1761 in the JavaScript engine by creating a typed function with JavaScript code
1762 in the name. Thanks Masato Kinugawa.
1763- Fixed a security issue where forbidden properties like constructor could be
1764 replaced by using unicode characters when creating an object. No known exploit,
1765 but could possibly allow arbitrary code execution. Thanks Masato Kinugawa.
1766
1767## 2017-10-18, version 3.16.5
1768
1769- Fixed #954: Functions `add` and `multiply` not working when
1770 passing three or more arrays or matrices.
1771
1772## 2017-10-01, version 3.16.4
1773
1774- Fixed #948, #949: function `simplify` returning wrong results or
1775 running into an infinite recursive loop. Thanks @ericman314.
1776- Fixed many small issues in the embedded docs. Thanks @Schnark.
1777
1778## 2017-08-28, version 3.16.3
1779
1780- Fixed #934: Wrong simplification of unary minus. Thanks @firepick1.
1781- Fixed #933: function `simplify` reordering operations. Thanks @firepick1.
1782- Fixed #930: function `isNaN` returning wrong result for complex
1783 numbers having just one of their parts (re/im) being `NaN`.
1784- Fixed #929: `FibonacciHeap.isEmpty` returning wrong result.
1785
1786## 2017-08-20, version 3.16.2
1787
1788- Fixed #924: a regression in `simplify` not accepting the signature
1789 `simplify(expr, rules, scope)` anymore. Thanks @firepick1.
1790- Fixed missing parenthesis when stringifying expressions containing
1791 implicit multiplications (see #922). Thanks @FSMaxB.
1792
1793## 2017-08-12, version 3.16.1
1794
1795- For security reasons, type checking is now done in a more strict
1796 way using functions like `isComplex(x)` instead of duck type checking
1797 like `x && x.isComplex === true`.
1798- Fixed #915: No access to property "name".
1799- Fixed #901: Simplify units when calling `unit.toNumeric()`.
1800 Thanks @AlexanderBeyn.
1801- Fixed `toString` of a parsed expression tree containing an
1802 immediately invoked function assignment not being wrapped in
1803 parenthesis (for example `(f(x) = x^2)(4)`).
1804
1805## 2017-08-06, version 3.16.0
1806
1807- Significant performance improvements in `math.simplify`.
1808 Thanks @firepick1.
1809- Improved API for `math.simplify`, optionally pass a scope with
1810 variables which are resolved, see #907. Thanks @firepick1.
1811- Fixed #912: math.js didn't work on IE10 anymore (regression
1812 since 3.15.0).
1813
1814## 2017-07-29, version 3.15.0
1815
1816- Added support for the dollar character `$` in symbol names (see #895).
1817- Allow objects with prototypes as scope again in the expression parser,
1818 this was disabled for security reasons some time ago. See #888, #899.
1819 Thanks @ThomasBrierley.
1820- Fixed #846: Issues in the functions `map`, `forEach`, and `filter`
1821 when used in the expression parser:
1822 - Not being able to use a function assignment as inline expression
1823 for the callback function.
1824 - Not being able to pass an inline expression as callback for `map`
1825 and `forEach`.
1826 - Index and original array/matrix not passed in `map` and `filter`.
1827
1828## 2017-07-05, version 3.14.2
1829
1830- Upgraded to `fraction.js@4.0.2`
1831- Fixed #891 using BigNumbers not working in browser environments.
1832
1833## 2017-06-30, version 3.14.1
1834
1835- Reverted to `fraction.js@4.0.0`, there is an issue with `4.0.1`
1836 in the browser.
1837
1838## 2017-06-30, version 3.14.0
1839
1840- Implemented set methods `setCartesian`, `setDifference`,
1841 `setDistinct`, `setIntersect`, `setIsSubset`, `setPowerset`,
1842 `setSize`. Thanks @Nekomajin42.
1843- Implemented method `toHTML` on nodes. Thanks @Nekomajin42.
1844- Implemented `compareNatural` and `sort([...], 'natural')`.
1845- Upgraded dependencies to the latest versions:
1846 - `complex.js@2.0.4`
1847 - `decimal.js@7.2.3`
1848 - `fraction.js@4.0.1`
1849 - `tiny-emitter@2.0.0`
1850 - And all devDependencies.
1851- Fixed #865: `splitUnit` can now deal with round-off errors.
1852 Thanks @ericman314.
1853- Fixed #876: incorrect definition for unit `erg`. Thanks @pjhampton.
1854- More informative error message when using single quotes instead of
1855 double quotes around a string. Thanks @HarrySarson.
1856
1857## 2017-05-27, version 3.13.3
1858
1859- Fixed a bug in function `intersection` of line and plane.
1860 Thanks @viclai.
1861- Fixed security vulnerabilities.
1862
1863## 2017-05-26, version 3.13.2
1864
1865- Disabled function `chain` inside the expression parser for security
1866 reasons (it's not needed there anyway).
1867- Fixed #856: function `subset` not returning non-primitive scalars
1868 from Arrays correctly. (like `math.eval('arr[1]', {arr: [math.bignumber(2)]})`.
1869- Fixed #861: physical constants not available in the expression parser.
1870
1871## 2017-05-12, version 3.13.1
1872
1873- Fixed creating units with an alias not working within the expression
1874 parser.
1875- Fixed security vulnerabilities. Thanks Sam.
1876
1877## 2017-05-12, version 3.13.0
1878
1879- Command line application can now evaluate inline expressions
1880 like `mathjs 1+2`. Thanks @slavaGanzin.
1881- Function `derivative` now supports `abs`. Thanks @tetslee.
1882- Function `simplify` now supports BigNumbers. Thanks @tetslee.
1883- Prevent against endless loops in `simplify`. Thanks @tetslee.
1884- Fixed #813: function `simplify` converting small numbers to inexact
1885 Fractions. Thanks @tetslee.
1886- Fixed #838: Function `simplify` now supports constants like `e`.
1887 Thanks @tetslee.
1888
1889## 2017-05-05, version 3.12.3
1890
1891- Fixed security vulnerabilities. Thanks Dan and Sam.
1892
1893## 2017-04-30, version 3.12.2
1894
1895- Added a rocket trajectory optimization example.
1896
1897## 2017-04-24, version 3.12.1
1898
1899- Fixed #804
1900 - Improved handling of powers of `Infinity`. Thanks @HarrySarson.
1901 - Fixed wrong formatting of complex NaN.
1902- Fixed security vulnerabilities in the expression parser.
1903 Thanks Sam and Dan.
1904
1905## 2017-04-17, version 3.12.0
1906
1907- Implemented QR decomposition, function `math.qr`. Thanks @HarrySarson.
1908- Fixed #824: Calling `math.random()` freezes IE and node.js.
1909
1910## 2017-04-08, version 3.11.5
1911
1912- More security measures in the expression parser.
1913 WARNING: the behavior of the expression parser is now more strict,
1914 some undocumented features may not work any longer.
1915 - Accessing and assigning properties is now only allowed on plain
1916 objects, not on classes, arrays, and functions anymore.
1917 - Accessing methods is restricted to a set of known, safe methods.
1918
1919## 2017-04-03, version 3.11.4
1920
1921- Fixed a security vulnerability in the expression parser. Thanks @xfix.
1922
1923## 2017-04-03, version 3.11.3
1924
1925- Fixed a security vulnerability in the expression parser. Thanks @xfix.
1926
1927## 2017-04-03, version 3.11.2
1928
1929- Fixed a security vulnerability in the expression parser. Thanks @xfix.
1930
1931## 2017-04-02, version 3.11.1
1932
1933- Fixed security vulnerabilities in the expression parser.
1934 Thanks Joe Vennix and @xfix.
1935
1936## 2017-04-02, version 3.11.0
1937
1938- Implemented method Unit.toSI() to convert a unit to base SI units.
1939 Thanks @ericman314.
1940- Fixed #821, #822: security vulnerabilities in the expression parser.
1941 Thanks @comex and @xfix.
1942
1943## 2017-03-31, version 3.10.3
1944
1945- More security fixes related to the ones fixed in `v3.10.2`.
1946
1947## 2017-03-31, version 3.10.2
1948
1949- Fixed a security vulnerability in the expression parser allowing
1950 execution of arbitrary JavaScript. Thanks @CapacitorSet and @denvit.
1951
1952## 2017-03-26, version 3.10.1
1953
1954- Fixed `xgcd` for negative values. Thanks @litmit.
1955- Fixed #807: function transform of existing functions not being removed when
1956 overriding such a function.
1957
1958## 2017-03-05, version 3.10.0
1959
1960- Implemented function `reshape`. Thanks @patgrasso and @ericman314.
1961- Implemented configuration option `seedRandom` for deterministic random
1962 numbers. Thanks @morsecodist.
1963- Small fixes in the docs. Thanks @HarrySarson.
1964- Dropped support for component package manager (which became deprecated about
1965 one and a half year ago).
1966
1967## 2017-02-22, version 3.9.3
1968
1969- Fixed #797: issue with production builds of React Native projects.
1970- Fixed `math.round` not accepting inputs `NaN`, `Infinity`, `-Infinity`.
1971- Upgraded all dependencies.
1972
1973## 2017-02-16, version 3.9.2
1974
1975- Fixed #795: Parse error in case of a multi-line expression with just comments.
1976
1977## 2017-02-06, version 3.9.1
1978
1979- Fixed #789: Math.js not supporting conversion of `string` to `BigNumber`,
1980 `Fraction`, or `Complex` number.
1981- Fixed #790: Expression parser did not pass function arguments of enclosing
1982 functions via `scope` to functions having `rawArgs = true`.
1983- Small fixes in the docs. Thanks @HarrySarson.
1984
1985## 2017-01-23, version 3.9.0
1986
1987- Implemented support for algebra: powerful new functions `simplify` and
1988 `derivative`. Thanks @ericman314, @tetslee, and @BigFav.
1989- Implemented Kronecker Product `kron`. Thanks @adamisntdead.
1990- Reverted `FunctionNode` not accepting a string as function name anymore.
1991- Fixed #765: `FunctionAssignmentNode.toString()` returning a string
1992 incompatible with the function assignment syntax.
1993
1994## 2016-12-15, version 3.8.1
1995
1996- Implemented function `mad` (median absolute deviation). Thanks @ruhleder.
1997- Fixed #762: expression parser failing to invoke a function returned
1998 by a function.
1999
2000## 2016-11-18, version 3.8.0
2001
2002- Functions `add` and `multiply` now accept more than two arguments. See #739.
2003- `OperatorNode` now supports more than two arguments. See #739. Thanks @FSMaxB.
2004- Implemented a method `Node.cloneDeep` for the expression nodes. See #745.
2005- Fixed a bug in `Node.clone()` not cloning implicit multiplication correctly.
2006 Thanks @FSMaxB.
2007- Fixed #737: Improved algorithm determining the best prefix for units.
2008 It will now retain the original unit like `1 cm` when close enough,
2009 instead of returning `10 mm`. Thanks @ericman314.
2010- Fixed #732: Allow letter-like unicode characters like Ohm `\u2126`.
2011- Fixed #749: Units `rad`, `deg`, and `grad` can now have prefixes like `millirad`.
2012- Some fixes in the docs and comments of examples. Thanks @HarrySarson.
2013
2014## 2016-11-05, version 3.7.0
2015
2016- Implemented method `Node.equals(other)` for all nodes of the expression parser.
2017- Implemented BigNumber support in function `arg()`.
2018- Command Line Interface loads faster.
2019- Implicit conversions between Fractions and BigNumbers throw a neat error now
2020 (See #710).
2021
2022## 2016-10-21, version 3.6.0
2023
2024- Implemented function `erf()`. THanks @patgrasso.
2025- Extended function `cross()` to support n-d vectors. Thanks @patgrasso.
2026- Extended function `pickRandom` with the option to pick multiple values from
2027 an array and give the values weights: `pickRandom(possibles, number, weights)`.
2028 Thanks @woylie.
2029- Parser now exposes test functions like `isAlpha` which can be replaced in
2030 order to adjust the allowed characters in variables names (See #715).
2031- Fixed #727: Parser not throwing an error for invalid implicit multiplications
2032 like `-2 2` and `2^3 4` (right after the second value of an operator).
2033- Fixed #688: Describe allowed variable names in the docs.
2034
2035## 2016-09-21, version 3.5.3
2036
2037- Some more fixes regarding numbers ending with a decimal mark (like `2.`).
2038
2039## 2016-09-20, version 3.5.2
2040
2041- Fixed numbers ending with a decimal mark (like `2.`) not being supported by
2042 the parser, solved the underlying ambiguity in the parser. See #707, #711.
2043
2044## 2016-09-12, version 3.5.1
2045
2046- Removed a left over console.log statement. Thanks @eknkc.
2047
2048## 2016-09-07, version 3.5.0
2049
2050- Comments of expressions are are now stored in the parsed nodes. See #690.
2051- Fixed function `print` not accepting an Object with formatting options as
2052 third parameter Thanks @ThomasBrierley.
2053- Fixed #707: The expression parser no longer accepts numbers ending with a dot
2054 like `2.`.
2055
2056## 2016-08-08, version 3.4.1
2057
2058- Fixed broken bundle files (`dist/math.js`, `dist/math.min.js`).
2059- Fixed some layout issues in the function reference docs.
2060
2061## 2016-08-07, version 3.4.0
2062
2063- Implemented support for custom units using `createUnit`. Thanks @ericman314.
2064- Implemented function `splitUnits`. Thanks @ericman314.
2065- Implemented function `isPrime`. Thanks @MathBunny.
2066
2067## 2016-07-05, version 3.3.0
2068
2069- Implemented function `isNaN`.
2070- Function `math.filter` now passes three arguments to the callback function:
2071 value, index, and array.
2072- Removed the check on the number of arguments from functions defined in the
2073 expression parser (see #665).
2074- Fixed #665: functions `map`, `forEach`, and `filter` now invoke callbacks
2075 which are a typed-function with the correct number of arguments.
2076
2077## 2016-04-26, version 3.2.1
2078
2079- Fixed #651: unable to perform calculations on "Unit-less" units.
2080- Fixed matrix.subset mutating the replacement matrix when unsqueezing it.
2081
2082## 2016-04-16, version 3.2.0
2083
2084- Implemented #644: method `Parser.getAll()` to retrieve all defined variables.
2085- Upgraded dependencies (decimal.js@5.0.8, fraction.js@3.3.1,
2086 typed-function@0.10.4).
2087- Fixed #601: Issue with unnamed typed-functions by upgrading to
2088 typed-function v0.10.4.
2089- Fixed #636: More strict `toTex` templates, reckon with number of arguments.
2090- Fixed #641: Bug in expression parser parsing implicit multiplication with
2091 wrong precedence in specific cases.
2092- Fixed #645: Added documentation about `engineering` notation of function
2093 `math.format`.
2094
2095## 2016-04-03, version 3.1.4
2096
2097- Using ES6 Math functions like `Math.sinh`, `Math.cbrt`, `Math.sign`, etc when
2098 available.
2099- Fixed #631: unit aliases `weeks`, `months`, and `years` where missing.
2100- Fixed #632: problem with escaped backslashes at the end of strings.
2101- Fixed #635: `Node.toString` options where not passed to function arguments.
2102- Fixed #629: expression parser throws an error when passing a number with
2103 decimal exponent instead of parsing them as implicit multiplication.
2104- Fixed #484, #555: inaccuracy of `math.sinh` for values between -1 and 1.
2105- Fixed #625: Unit `in` (`inch`) not always working due to ambiguity with
2106 the operator `a in b` (alias of `a to b`).
2107
2108## 2016-03-24, version 3.1.3
2109
2110- Fix broken bundle.
2111
2112## 2016-03-24, version 3.1.2
2113
2114- Fix broken npm release.
2115
2116## 2016-03-24, version 3.1.1
2117
2118- Fixed #621: a bug in parsing implicit multiplications like `(2)(3)+4`.
2119- Fixed #623: `nthRoot` of zero with a negative root returned `0` instead of
2120 `Infinity`.
2121- Throw an error when functions `min`, `max`, `mean`, or `median` are invoked
2122 with multiple matrices as arguments (see #598).
2123
2124## 2016-03-19, version 3.1.0
2125
2126- Hide multiplication operator by default when outputting `toTex` and `toString`
2127 for implicit multiplications. Implemented and option to output the operator.
2128- Implemented unit `kip` and alias `kips`. Thanks @hgupta9.
2129- Added support for prefixes for units `mol` and `mole`. Thanks @stu-blair.
2130- Restored support for implicit multiplications like `2(3+4)` and `(2+3)(4+5)`.
2131- Some improvements in the docs.
2132- Added automatic conversions from `boolean` and `null` to `Fraction`,
2133 and conversions from `Fraction` to `Complex`.
2134
2135## 2016-03-04, version 3.0.0
2136
2137### breaking changes
2138
2139- More restricted support for implicit multiplication in the expression
2140 parser: `(...)(...)` is now evaluated as a function invocation,
2141 and `[...][...]` as a matrix subset.
2142- Matrix multiplication no longer squeezes scalar outputs to a scalar value,
2143 but leaves them as they are: a vector or matrix containing a single value.
2144 See #529.
2145- Assignments in the expression parser now return the assigned value rather
2146 than the created or updated object (see #533). Example:
2147
2148 ```
2149 A = eye(3)
2150 A[1,1] = 2 # this assignment now returns 2 instead of A
2151 ```
2152
2153- Expression parser now supports objects. This involves a refactoring and
2154 extension in expression nodes:
2155 - Implemented new node `ObjectNode`.
2156 - Refactored `AssignmentNode`, `UpdateNode`, and `IndexNode` are refactored
2157 into `AccessorNode`, `AssignmentNode`, and `IndexNode` having a different API.
2158- Upgraded the used BigNumber library `decimal.js` to v5. Replaced the
2159 trigonometric functions of math.js with those provided in decimal.js v5.
2160 This can give slightly different behavior qua round-off errors.
2161- Replaced the internal `Complex.js` class with the `complex.js` library
2162 created by @infusion.
2163- Entries in a matrix (typically numbers, BigNumbers, Units, etc) are now
2164 considered immutable, they are no longer copied when performing operations on
2165 the entries, improving performance.
2166- Implemented nearly equal comparison for relational functions (`equal`,
2167 `larger`, `smaller`, etc.) when using BigNumbers.
2168- Changed the casing of the configuration options `matrix` (`Array` or `Matrix`)
2169 and `number` (`number`, `BigNumber`, `Fraction`) such that they now match
2170 the type returned by `math.typeof`. Wrong casing gives a console warning but
2171 will still work.
2172- Changed the default config value for `epsilon` from `1e-14` to `1e-12`,
2173 see #561.
2174
2175### non-breaking changes
2176
2177- Extended function `pow` to return the real root for cubic roots of negative
2178 numbers. See #525, #482, #567.
2179- Implemented support for JSON objects in the expression parser and the
2180 function `math.format`.
2181- Function `math.fraction` now supports `BigNumber`, and function
2182 `math.bignumber` now supports `Fraction`.
2183- Expression parser now allows function and/or variable assignments inside
2184 accessors and conditionals, like `A[x=2]` or `a > 2 ? b="ok" : b="fail"`.
2185- Command line interface:
2186 - Outputs the variable name of assignments.
2187 - Fixed not rounding BigNumbers to 14 digits like numbers.
2188 - Fixed non-working autocompletion of user defined variables.
2189- Reorganized and extended docs, added docs on classes and more. Thanks @hgupta9.
2190- Added new units `acre`, `hectare`, `torr`, `bar`, `mmHg`, `mmH2O`, `cmH2O`,
2191 and added new aliases `acres`, `hectares`, `sqfeet`, `sqyard`, `sqmile`,
2192 `sqmiles`, `mmhg`, `mmh2o`, `cmh2o`. Thanks @hgupta9.
2193- Fixed a bug in the toString method of an IndexNode.
2194- Fixed angle units `deg`, `rad`, `grad`, `cycle`, `arcsec`, and `arcmin` not
2195 being defined as BigNumbers when configuring to use BigNumbers.
2196
2197## 2016-02-03, version 2.7.0
2198
2199- Added more unit aliases for time: `secs`, `mins`, `hr`, `hrs`. See #551.
2200- Added support for doing operations with mixed `Fractions` and `BigNumbers`.
2201- Fixed #540: `math.intersect()` returning null in some cases. Thanks @void42.
2202- Fixed #546: Cannot import BigNumber, Fraction, Matrix, Array.
2203 Thanks @brettjurgens.
2204
2205## 2016-01-08, version 2.6.0
2206
2207- Implemented (complex) units `VA` and `VAR`.
2208- Implemented time units for weeks, months, years, decades, centuries, and
2209 millennia. Thanks @owenversteeg.
2210- Implemented new notation `engineering` in function `math.format`.
2211 Thanks @johnmarinelli.
2212- Fixed #523: In some circumstances, matrix subset returned a scalar instead
2213 of the correct subset.
2214- Fixed #536: A bug in an internal method used for sparse matrices.
2215
2216## 2015-12-05, version 2.5.0
2217
2218- Implemented support for numeric types `Fraction` and `BigNumber` in units.
2219- Implemented new method `toNumeric` for units.
2220- Implemented new units `arcsec`, `arcsecond`, `arcmin`, `arcminute`.
2221 Thanks @devdevdata222.
2222- Implemented new unit `Herts` (`Hz`). Thanks @SwamWithTurtles.
2223- Fixed #485: Scoping issue with variables both used globally as well as in a
2224 function definition.
2225- Fixed: Function `number` didn't support `Fraction` as input.
2226
2227## 2015-11-14, version 2.4.2
2228
2229- Fixed #502: Issue with `format` in some JavaScript engines.
2230- Fixed #503: Removed trailing commas and the use of keyword `import` as
2231 property, as this gives issues with old JavaScript engines.
2232
2233## 2015-10-29, version 2.4.1
2234
2235- Fixed #480: `nthRoot` not working on Internet Explorer (up to IE11).
2236- Fixed #490: `nthRoot` returning an error for negative values like
2237 `nthRoot(-2, 3)`.
2238- Fixed #489: an issue with initializing a sparse matrix without data.
2239 Thanks @Retsam.
2240- Fixed: #493: function `combinations` did not throw an exception for
2241 non-integer values of `k`.
2242- Fixed: function `import` did not override typed functions when the option
2243 override was set true.
2244- Fixed: added functions `math.sparse` and `math.index` to the reference docs,
2245 they where missing.
2246- Fixed: removed memoization from `gamma` and `factorial` functions, this
2247 could blow up memory.
2248
2249## 2015-10-09, version 2.4.0
2250
2251- Added support in the expression parser for mathematical alphanumeric symbols
2252 in the expression parser: unicode range \u{1D400} to \u{1D7FF} excluding
2253 invalid code points.
2254- Extended function `distance` with more signatures. Thanks @kv-kunalvyas.
2255- Fixed a bug in functions `sin` and `cos`, which gave wrong results for
2256 BigNumber integer values around multiples of tau (i.e. `sin(bignumber(7))`).
2257- Fixed value of unit `stone`. Thanks @Esvandiary for finding the error.
2258
2259## 2015-09-19, version 2.3.0
2260
2261- Implemented function `distance`. Thanks @devanp92.
2262- Implemented support for Fractions in function `lcm`. Thanks @infusion.
2263- Implemented function `cbrt` for numbers, complex numbers, BigNumbers, Units.
2264- Implemented function `hypot`.
2265- Upgraded to fraction.js v3.0.0.
2266- Fixed #450: issue with non sorted index in sparse matrices.
2267- Fixed #463, #322: inconsistent handling of implicit multiplication.
2268- Fixed #444: factorial of infinity not returning infinity.
2269
2270## 2015-08-30, version 2.2.0
2271
2272- Units with powers (like `m^2` and `s^-1`) now output with the best prefix.
2273- Implemented support for units to `abs`, `cube`, `sign`, `sqrt`, `square`.
2274 Thanks @ericman314.
2275- Implemented function `catalan` (Combinatorics). Thanks @devanp92.
2276- Improved the `canDefineProperty` check to return false in case of IE8, which
2277 has a broken implementation of `defineProperty`. Thanks @golmansax.
2278- Fixed function `to` not working in case of a simplified unit.
2279- Fixed #437: an issue with row swapping in `lup`, also affecting `lusolve`.
2280
2281## 2015-08-12, version 2.1.1
2282
2283- Fixed wrong values of the physical constants `speedOfLight`, `molarMassC12`,
2284 and `magneticFluxQuantum`. Thanks @ericman314 for finding two of them.
2285
2286## 2015-08-11, version 2.1.0
2287
2288- Implemented derived units (like `110 km/h in m/s`). Thanks @ericman314.
2289- Implemented support for electric units. Thanks @ericman314.
2290- Implemented about 50 physical constants like `speedOfLight`, `gravity`, etc.
2291- Implemented function `kldivergence` (Kullback-Leibler divergence).
2292 Thanks @saromanov.
2293- Implemented function `mode`. Thanks @kv-kunalvyas.
2294- Added support for unicode characters in the expression parser: greek letters
2295 and latin letters with accents. See #265.
2296- Internal functions `Unit.parse` and `Complex.parse` now throw an Error
2297 instead of returning null when passing invalid input.
2298
2299## 2015-07-29, version 2.0.1
2300
2301- Fixed operations with mixed fractions and numbers be converted to numbers
2302 instead of fractions.
2303
2304## 2015-07-28, version 2.0.0
2305
2306- Large internal refactoring:
2307 - performance improvements.
2308 - allows to create custom bundles
2309 - functions are composed using `typed-function` and are extensible
2310- Implemented support for fractions, powered by the library `fraction.js`.
2311- Implemented matrix LU decomposition with partial pivoting and a LU based
2312 linear equations solver (functions `lup` and `lusolve`). Thanks @rjbaucells.
2313- Implemented a new configuration option `predictable`, which can be set to
2314 true in order to ensure predictable function output types.
2315- Implemented function `intersect`. Thanks @kv-kunalvyas.
2316- Implemented support for adding `toTex` properties to custom functions.
2317 Thanks @FSMaxB.
2318- Implemented support for complex values to `nthRoot`. Thanks @gangachris.
2319- Implemented util functions `isInteger`, `isNegative`, `isNumeric`,
2320 `isPositive`, and `isZero`.
2321
2322### breaking changes
2323
2324- String input is now converted to numbers by default for all functions.
2325- Adding two strings will no longer concatenate them, but will convert the
2326 strings to numbers and add them.
2327- Function `index` does no longer accept an array `[start, end, step]`, but
2328 instead accepts an array with arbitrary index values. It also accepts
2329 a `Range` object as input.
2330- Function `typeof` no longer returns lower case names, but now returns lower
2331 case names for primitives (like `number`, `boolean`, `string`), and
2332 upper-camel-case for non-primitives (like `Array`, `Complex`, `Function`).
2333- Function `import` no longer supports a module name as argument. Instead,
2334 modules can be loaded using require: `math.import(require('module-name'))`.
2335- Function `import` has a new option `silent` to ignore errors, and throws
2336 errors on duplicates by default.
2337- Method `Node.compile()` no longer needs `math` to be passed as argument.
2338- Reintroduced method `Node.eval([scope])`.
2339- Function `sum` now returns zero when input is an empty array. Thanks @FSMAxB.
2340- The size of Arrays is no longer validated. Matrices will validate this on
2341 creation.
2342
2343## 2015-07-12, version 1.7.1
2344
2345- Fixed #397: Inaccuracies in nthRoot for very large values, and wrong results
2346 for very small values. (backported from v2)
2347- Fixed #405: Parser throws error when defining a function in a multiline
2348 expression.
2349
2350## 2015-05-31, version 1.7.0
2351
2352- Implemented function `quantileSeq` and `partitionSelect`. Thanks @BigFav.
2353- Implemented functions `stirlingS2`, `bellNumbers`, `composition`, and
2354 `multinomial`. Thanks @devanp92.
2355- Improved the performance of `median` (see #373). Thanks @BigFav.
2356- Extended the command line interface with a `mode` option to output either
2357 the expressions result, string representation, or tex representation.
2358 Thanks @FSMaxB.
2359- Fixed #309: Function median mutating the input matrix. Thanks @FSMaxB.
2360- Fixed `Node.transform` not recursing over replaced parts of the
2361 node tree (see #349).
2362- Fixed #381: issue in docs of `randomInt`.
2363
2364## 2015-04-22, version 1.6.0
2365
2366- Improvements in `toTex`. Thanks @FSMaxB.
2367- Fixed #328: `abs(0 + 0i)` evaluated to `NaN`.
2368- Fixed not being able to override lazy loaded constants.
2369
2370## 2015-04-09, version 1.5.2
2371
2372- Fixed #313: parsed functions did not handle recursive calls correctly.
2373- Fixed #251: binary prefix and SI prefix incorrectly used for byte. Now
2374 following SI standards (`1 KiB == 1024 B`, `1 kB == 1000 B`).
2375- Performance improvements in parsed functions.
2376
2377## 2015-04-08, version 1.5.1
2378
2379- Fixed #316: a bug in rounding values when formatting.
2380- Fixed #317, #319: a bug in formatting negative values.
2381
2382## 2015-03-28, version 1.5.0
2383
2384- Added unit `stone` (6.35 kg).
2385- Implemented support for sparse matrices. Thanks @rjbaucells.
2386- Implemented BigNumber support for function `atan2`. Thanks @BigFav.
2387- Implemented support for custom LaTeX representations. Thanks @FSMaxB.
2388- Improvements and bug fixes in outputting parentheses in `Node.toString` and
2389 `Node.toTex` functions. Thanks @FSMaxB.
2390- Fixed #291: function `format` sometimes returning exponential notation when
2391 it should return a fixed notation.
2392
2393## 2015-02-28, version 1.4.0
2394
2395- Implemented trigonometric functions:
2396 `acosh`, `acoth`, `acsch`, `asech`, `asinh`, `atanh`, `acot`, `acsc`, `asec`.
2397 Thanks @BigFav.
2398- Added BigNumber support for functions: `cot`, `csc`, `sec`, `coth`,
2399 `csch`, `sech`. Thanks @BigFav.
2400- Implemented support for serialization and deserialization of math.js data
2401 types.
2402- Fixed the calculation of `norm()` and `abs()` for large complex numbers.
2403 Thanks @rjbaucells.
2404- Fixed #281: improved formatting complex numbers. Round the real or imaginary
2405 part to zero when the difference is larger than the configured precision.
2406
2407## 2015-02-09, version 1.3.0
2408
2409- Implemented BigNumber implementations of most trigonometric functions: `sin`,
2410 `cos`, `tan`, `asin`, `acos`, `atan`, `cosh`, `sinh`, `tanh`. Thanks @BigFav.
2411- Implemented function `trace`. Thanks @pcorey.
2412- Faster loading of BigNumber configuration with a high precision by lazy
2413 loading constants like `pi` and `e`.
2414- Fixed constants `NaN` and `Infinity` not being BigNumber objects when
2415 BigNumbers are configured.
2416- Fixed missing parentheses in the `toTex` representation of function
2417 `permutations`.
2418- Some minor fixes in the docs. Thanks @KenanY.
2419
2420## 2014-12-25, version 1.2.0
2421
2422- Support for bitwise operations `bitAnd`, `bitNot`, `bitOr`, `bitXor`,
2423 `leftShift`, `rightArithShift`, and `rightLogShift`. Thanks @BigFav.
2424- Support for boolean operations `and`, `not`, `or`, `xor`. Thanks @BigFav.
2425- Support for `gamma` function. Thanks @BigFav.
2426- Converting a unit without value will now result in a unit *with* value,
2427 i.e. `inch in cm` will return `2.54 cm` instead of `cm`.
2428- Improved accuracy of `sinh` and complex `cos` and `sin`. Thanks @pavpanchekha.
2429- Renamed function `select` to `chain`. The old function `select` will remain
2430 functional until math.js v2.0.
2431- Upgraded to decimal.js v4.0.1 (BigNumber library).
2432
2433## 2014-11-22, version 1.1.1
2434
2435- Fixed Unit divided by Number returning zero.
2436- Fixed BigNumber downgrading to Number for a negative base in `pow`.
2437- Fixed some typos in error messaging (thanks @andy0130tw) and docs.
2438
2439## 2014-11-15, version 1.1.0
2440
2441- Implemented functions `dot` (dot product), `cross` (cross product), and
2442 `nthRoot`.
2443- Officially opened up the API of expression trees:
2444 - Documented the API.
2445 - Implemented recursive functions `clone`, `map`, `forEach`, `traverse`,
2446 `transform`, and `filter` for expression trees.
2447 - Parameter `index` in the callbacks of `map` and `forEach` are now cloned
2448 for every callback.
2449 - Some internal refactoring inside nodes to make the API consistent:
2450 - Renamed `params` to `args` and vice versa to make things consistent.
2451 - Renamed `Block.nodes` to `Block.blocks`.
2452 - `FunctionNode` now has a `name: string` instead of a `symbol: SymbolNode`.
2453 - Changed constructor of `RangeNode` to
2454 `new RangeNode(start: Node, end: Node [, step: Node])`.
2455 - Nodes for a `BlockNode` must now be passed via the constructor instead
2456 of via a function `add`.
2457- Fixed `2e` giving a syntax error instead of being parsed as `2 * e`.
2458
2459## 2014-09-12, version 1.0.1
2460
2461- Disabled array notation for ranges in a matrix index in the expression parser
2462 (it is confusing and redundant there).
2463- Fixed a regression in the build of function subset not being able to return
2464 a scalar.
2465- Fixed some missing docs and broken links in the docs.
2466
2467## 2014-09-04, version 1.0.0
2468
2469- Implemented a function `filter(x, test)`.
2470- Removed `math.distribution` for now, needs some rethinking.
2471- `math.number` can convert units to numbers (requires a second argument)
2472- Fixed some precedence issues with the range and conversion operators.
2473- Fixed an zero-based issue when getting a matrix subset using an index
2474 containing a matrix.
2475
2476## 2014-08-21, version 0.27.0
2477
2478- Implemented functions `sort(x [, compare])` and `flatten(x)`.
2479- Implemented support for `null` in all functions.
2480- Implemented support for "rawArgs" functions in the expression parser. Raw
2481 functions are invoked with unevaluated parameters (nodes).
2482- Expressions in the expression parser can now be spread over multiple lines,
2483 like '2 +\n3'.
2484- Changed default value of the option `wrap` of function `math.import` to false.
2485- Changed the default value for new entries in a resized matrix when to zero.
2486 To leave new entries uninitialized, use the new constant `math.uninitialized`
2487 as default value.
2488- Renamed transform property from `__transform__` to `transform`, and documented
2489 the transform feature.
2490- Fixed a bug in `math.import` not applying options when passing a module name.
2491- A returned matrix subset is now only squeezed when the `index` consists of
2492 scalar values, and no longer for ranges resolving into a single value.
2493
2494## 2014-08-03, version 0.26.0
2495
2496- A new instance of math.js can no longer be created like `math([options])`,
2497 to prevent side effects from math being a function instead of an object.
2498 Instead, use the function `math.create([options])` to create a new instance.
2499- Implemented `BigNumber` support for all constants: `pi`, `tau`, `e`, `phi`,
2500 `E`, `LN2`, `LN10`, `LOG2E`, `LOG10E`, `PI`, `SQRT1_2`, and `SQRT2`.
2501- Implemented `BigNumber` support for functions `gcd`, `xgcd`, and `lcm`.
2502- Fixed function `gxcd` returning an Array when math.js was configured
2503 as `{matrix: 'matrix'}`.
2504- Multi-line expressions now return a `ResultSet` instead of an `Array`.
2505- Implemented transforms (used right now to transform one-based indices to
2506 zero-based for expressions).
2507- When used inside the expression parser, functions `concat`, `min`, `max`,
2508 and `mean` expect an one-based dimension number.
2509- Functions `map` and `forEach` invoke the callback with one-based indices
2510 when used from within the expression parser.
2511- When adding or removing dimensions when resizing a matrix, the dimensions
2512 are added/removed from the inner side (right) instead of outer side (left).
2513- Improved index out of range errors.
2514- Fixed function `concat` not accepting a `BigNumber` for parameter `dim`.
2515- Function `squeeze` now squeezes both inner and outer singleton dimensions.
2516- Output of getting a matrix subset is not automatically squeezed anymore
2517 except for scalar output.
2518- Renamed `FunctionNode` to `FunctionAssignmentNode`, and renamed `ParamsNode`
2519 to `FunctionNode` for more clarity.
2520- Fixed broken auto completion in CLI.
2521- Some minor fixes.
2522
2523## 2014-07-01, version 0.25.0
2524
2525- The library now immediately returns a default instance of mathjs, there is
2526 no need to instantiate math.js in a separate step unless one ones to set
2527 configuration options:
2528
2529 // instead of:
2530 var mathjs = require('mathjs'), // load math.js
2531 math = mathjs(); // create an instance
2532
2533 // just do:
2534 var math = require('mathjs');
2535- Implemented support for implicit multiplication, like `math.eval('2a', {a:3})`
2536 and `math.eval('(2+3)(1-3)')`. This changes behavior of matrix indexes as
2537 well: an expression like `[...][...]` is not evaluated as taking a subset of
2538 the first matrix, but as an implicit multiplication of two matrices.
2539- Removed utility function `ifElse`. This function is redundant now the
2540 expression parser has a conditional operator `a ? b : c`.
2541- Fixed a bug with multiplying a number with a temperature,
2542 like `math.eval('10 * celsius')`.
2543- Fixed a bug with symbols having value `undefined` not being evaluated.
2544
2545## 2014-06-20, version 0.24.1
2546
2547- Something went wrong with publishing on npm.
2548
2549## 2014-06-20, version 0.24.0
2550
2551- Added constant `null`.
2552- Functions `equal` and `unequal` support `null` and `undefined` now.
2553- Function `typeof` now recognizes regular expressions as well.
2554- Objects `Complex`, `Unit`, and `Help` now return their string representation
2555 when calling `.valueOf()`.
2556- Changed the default number of significant digits for BigNumbers from 20 to 64.
2557- Changed the behavior of the conditional operator (a ? b : c) to lazy
2558 evaluating.
2559- Fixed imported, wrapped functions not accepting `null` and `undefined` as
2560 function arguments.
2561
2562## 2014-06-10, version 0.23.0
2563
2564- Renamed some functions (everything now has a logical, camel case name):
2565 - Renamed functions `edivide`, `emultiply`, and `epow` to `dotDivide`,
2566 `dotMultiply`, and `dotPow` respectively.
2567 - Renamed functions `smallereq` and `largereq` to `smallerEq` and `largerEq`.
2568 - Renamed function `unary` to `unaryMinus` and added support for strings.
2569- `end` is now a reserved keyword which cannot be used as function or symbol
2570 name in the expression parser, and is not allowed in the scope against which
2571 an expression is evaluated.
2572- Implemented function `unaryPlus` and unary plus operator.
2573- Implemented function `deepEqual` for matrix comparisons.
2574- Added constant `phi`, the golden ratio (`phi = 1.618...`).
2575- Added constant `version`, returning the version number of math.js as string.
2576- Added unit `drop` (`gtt`).
2577- Fixed not being able to load math.js using AMD/require.js.
2578- Changed signature of `math.parse(expr, nodes)` to `math.parse(expr, options)`
2579 where `options: {nodes: Object.<String, Node>}`
2580- Removed matrix support from conditional function `ifElse`.
2581- Removed automatic assignment of expression results to variable `ans`.
2582 This functionality can be restored by pre- or postprocessing every evaluation,
2583 something like:
2584
2585 function evalWithAns (expr, scope) {
2586 var ans = math.eval(expr, scope);
2587 if (scope) {
2588 scope.ans = ans;
2589 }
2590 return ans;
2591 }
2592
2593## 2014-05-22, version 0.22.0
2594
2595- Implemented support to export expressions to LaTeX. Thanks Niels Heisterkamp
2596 (@nheisterkamp).
2597- Output of matrix multiplication is now consistently squeezed.
2598- Added reference documentation in the section /docs/reference.
2599- Fixed a bug in multiplying units without value with a number (like `5 * cm`).
2600- Fixed a bug in multiplying two matrices containing vectors (worked fine for
2601 arrays).
2602- Fixed random functions not accepting Matrix as input, and always returning
2603 a Matrix as output.
2604
2605## 2014-05-13, version 0.21.1
2606
2607- Removed `crypto` library from the bundle.
2608- Deprecated functions `Parser.parse` and `Parser.compile`. Use
2609 `math.parse` and `math.compile` instead.
2610- Fixed function `add` not adding strings and matrices element wise.
2611- Fixed parser not being able to evaluate an exponent followed by a unary minus
2612 like `2^-3`, and a transpose followed by an index like `[3]'[1]`.
2613
2614## 2014-04-24, version 0.21.0
2615
2616- Implemented trigonometric hyperbolic functions `cosh`, `coth`, `csch`,
2617 `sech`, `sinh`, `tanh`. Thanks Rogelio J. Baucells (@rjbaucells).
2618- Added property `type` to all expression nodes in an expression tree.
2619- Fixed functions `log`, `log10`, `pow`, and `sqrt` not supporting complex
2620 results from BigNumber input (like `sqrt(bignumber(-4))`).
2621
2622## 2014-04-16, version 0.20.0
2623
2624- Switched to module `decimal.js` for BigNumber support, instead of
2625 `bignumber.js`.
2626- Implemented support for polar coordinates to the `Complex` datatype.
2627 Thanks Finn Pauls (@finnp).
2628- Implemented BigNumber support for functions `exp`, `log`, and `log10`.
2629- Implemented conditional operator `a ? b : c` in expression parser.
2630- Improved floating point comparison: the functions now check whether values
2631 are nearly equal, against a configured maximum relative difference `epsilon`.
2632 Thanks Rogelio J. Baucells (@rjbaucells).
2633- Implemented function `norm`. Thanks Rogelio J. Baucells (@rjbaucells).
2634- Improved function `ifElse`, is now specified for special data types too.
2635- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli).
2636- Implemented `BigNumber` support for functions `det` and `diag`.
2637- Added unit alias `lbs` (pound mass).
2638- Changed configuration option `decimals` to `precision` (applies to BigNumbers
2639 only).
2640- Fixed support for element-wise comparisons between a string and a matrix.
2641- Fixed: expression parser now trows IndexErrors with one-based indices instead
2642 of zero-based.
2643- Minor bug fixes.
2644
2645## 2014-03-30, version 0.19.0
2646
2647- Implemented functions `compare`, `sum`, `prod`, `var`, `std`, `median`.
2648- Implemented function `ifElse` Thanks @mtraynham.
2649- Minor bug fixes.
2650
2651## 2014-02-15, version 0.18.1
2652
2653- Added unit `feet`.
2654- Implemented function `compile` (shortcut for parsing and then compiling).
2655- Improved performance of function `pow` for matrices. Thanks @hamadu.
2656- Fixed broken auto completion in the command line interface.
2657- Fixed an error in function `combinations` for large numbers, and
2658 improved performance of both functions `combinations` and `permutations`.
2659
2660## 2014-01-18, version 0.18.0
2661
2662- Changed matrix index notation of expression parser from round brackets to
2663 square brackets, for example `A[1, 1:3]` instead of `A(1, 1:3)`.
2664- Removed need to use the `function` keyword for function assignments in the
2665 expression parser, you can define a function now like `f(x) = x^2`.
2666- Implemented a compilation step in the expression parser: expressions are
2667 compiled into JavaScript, giving much better performance (easily 10x as fast).
2668- Renamed unit conversion function and operator `in` to `to`. Operator `in` is
2669 still available in the expression parser as an alias for `to`. Added unit
2670 `in`, an abbreviation for `inch`. Thanks Elijah Insua (@tmpvar).
2671- Added plurals and aliases for units.
2672- Implemented an argument `includeEnd` for function `range` (false by default).
2673- Ranges in the expression parser now support big numbers.
2674- Implemented functions `permutations` and `combinations`.
2675 Thanks Daniel Levin (@daniel-levin).
2676- Added lower case abbreviation `l` for unit litre.
2677
2678## 2013-12-19, version 0.17.1
2679
2680- Fixed a bug with negative temperatures.
2681- Fixed a bug with prefixes of units squared meter `m2` and cubic meter `m3`.
2682
2683## 2013-12-12, version 0.17.0
2684
2685- Renamed and flattened configuration settings:
2686 - `number.defaultType` is now `number`.
2687 - `number.precision` is now `decimals`.
2688 - `matrix.defaultType` is now `matrix`.
2689- Function `multiply` now consistently outputs a complex number on complex input.
2690- Fixed `mod` and `in` not working as function (only as operator).
2691- Fixed support for old browsers (IE8 and older), compatible when using es5-shim.
2692- Fixed support for Java's ScriptEngine.
2693
2694## 2013-11-28, version 0.16.0
2695
2696- Implemented BigNumber support for arbitrary precision calculations.
2697 Added settings `number.defaultType` and `number.precision` to configure
2698 big numbers.
2699- Documentation is extended.
2700- Removed utility functions `isScalar`, `toScalar`, `isVector`, `toVector`
2701 from `Matrix` and `Range`. Use `math.squeeze` and `math.size` instead.
2702- Implemented functions `get` and `set` on `Matrix`, for easier and faster
2703 retrieval/replacement of elements in a matrix.
2704- Implemented function `resize`, handling matrices, scalars, and strings.
2705- Functions `ones` and `zeros` now return an empty matrix instead of a
2706 number 1 or 0 when no arguments are provided.
2707- Implemented functions `min` and `max` for `Range` and `Index`.
2708- Resizing matrices now leaves new elements undefined by default instead of
2709 filling them with zeros. Function `resize` now has an extra optional
2710 parameter `defaultValue`.
2711- Range operator `:` in expression parser has been given a higher precedence.
2712- Functions don't allow arguments of unknown type anymore.
2713- Options be set when constructing a math.js instance or using the new function
2714 `config(options`. Options are no longer accessible via `math.options`.
2715- Renamed `scientific` notation to `exponential` in function `format`.
2716- Function `format` outputs exponential notation with positive exponents now
2717 always with `+` sign, so outputs `2.1e+3` instead of `2.1e3`.
2718- Fixed function `squeeze` not being able squeeze into a scalar.
2719- Some fixes and performance improvements in the `resize` and `subset`
2720 functions.
2721- Function `size` now adheres to the option `matrix.defaultType` for scalar
2722 input.
2723- Minor bug fixes.
2724
2725## 2013-10-26, version 0.15.0
2726
2727- Math.js must be instantiated now, static calls are no longer supported. Usage:
2728 - node.js: `var math = require('mathjs')();`
2729 - browser: `var math = mathjs();`
2730- Implemented support for multiplying vectors with matrices.
2731- Improved number formatting:
2732 - Function `format` now support various options: precision, different
2733 notations (`fixed`, `scientific`, `auto`), and more.
2734 - Numbers are no longer rounded to 5 digits by default when formatted.
2735 - Implemented a function `format` for `Matrix`, `Complex`, `Unit`, `Range`,
2736 and `Selector` to format using options.
2737 - Function `format` does only stringify values now, and has a new parameter
2738 `precision` to round to a specific number of digits.
2739 - Removed option `math.options.precision`,
2740 use `math.format(value [, precision])` instead.
2741 - Fixed formatting numbers as scientific notation in some cases returning
2742 a zero digit left from the decimal point. (like "0.33333e8" rather than
2743 "3.3333e7"). Thanks @husayt.
2744- Implemented a function `print` to interpolate values in a template string,
2745 this functionality was moved from the function `format`.
2746- Implemented statistics function `mean`. Thanks Guillermo Indalecio Fernandez
2747 (@guillermobox).
2748- Extended and changed `max` and `min` for multi dimensional matrices: they now
2749 return the maximum and minimum of the flattened array. An optional second
2750 argument `dim` allows to calculate the `max` or `min` for specified dimension.
2751- Renamed option `math.options.matrix.default` to
2752 `math.options.matrix.defaultType`.
2753- Removed support for comparing complex numbers in functions `smaller`,
2754 `smallereq`, `larger`, `largereq`. Complex numbers cannot be ordered.
2755
2756## 2013-10-08, version 0.14.0
2757
2758- Introduced an option `math.options.matrix.default` which can have values
2759 `matrix` (default) or `array`. This option is used by the functions `eye`,
2760 `ones`, `range`, and `zeros`, to determine the type of matrix output.
2761- Getting a subset of a matrix will automatically squeeze the resulting subset,
2762 setting a subset of a matrix will automatically unsqueeze the given subset.
2763- Removed concatenation of nested arrays in the expression parser.
2764 You can now input nested arrays like in JavaScript. Matrices can be
2765 concatenated using the function `concat`.
2766- The matrix syntax `[...]` in the expression parser now creates 1 dimensional
2767 matrices by default. `math.eval('[1,2,3,4]')` returns a matrix with
2768 size `[4]`, `math.eval('[1,2;3,4]')` returns a matrix with size `[2,2]`.
2769- Documentation is restructured and extended.
2770- Fixed non working operator `mod` (modulus operator).
2771
2772## 2013-09-03, version 0.13.0
2773
2774- Implemented support for booleans in all relevant functions.
2775- Implemented functions `map` and `forEach`. Thanks Sebastien Piquemal (@sebpic).
2776- All construction functions can be used to convert the type of variables,
2777 also element-wise for all elements in an Array or Matrix.
2778- Changed matrix indexes of the expression parser to one-based with the
2779 upper-bound included, similar to most math applications. Note that on a
2780 JavaScript level, math.js uses zero-based indexes with excluded upper-bound.
2781- Removed support for scalars in the function `subset`, it now only supports
2782 Array, Matrix, and String.
2783- Removed the functions `get` and `set` from a selector, they are a duplicate
2784 of the function `subset`.
2785- Replaced functions `get` and `set` of `Matrix` with a single function
2786 `subset`.
2787- Some moving around with code and namespaces:
2788 - Renamed namespace `math.expr` to `math.expression` (contains Scope, Parser,
2789 node objects).
2790 - Renamed namespace `math.docs` to `math.expression.docs`.
2791 - Moved `math.expr.Selector` to `math.chaining.Selector`.
2792- Fixed some edge cases in functions `lcm` and `xgcd`.
2793
2794## 2013-08-22, version 0.12.1
2795
2796- Fixed outdated version of README.md.
2797- Fixed a broken unit test.
2798
2799## 2013-08-22, version 0.12.0
2800
2801- Implemented functions `random([min, max])`, `randomInt([min, max])`,
2802 `pickRandom(array)`. Thanks Sebastien Piquemal (@sebpic).
2803- Implemented function `distribution(name)`, generating a distribution object
2804 with functions `random`, `randomInt`, `pickRandom` for different
2805 distributions. Currently supporting `uniform` and `normal`.
2806- Changed the behavior of `range` to exclude the upper bound, so `range(1, 4)`
2807 now returns `[1, 2, 3]` instead of `[1, 2, 3, 4]`.
2808- Changed the syntax of `range`, which is now `range(start, end [, step])`
2809 instead of `range(start, [step, ] end)`.
2810- Changed the behavior of `ones` and `zeros` to geometric dimensions, for
2811 example `ones(3)` returns a vector with length 3, filled with ones, and
2812 `ones(3,3)` returns a 2D array with size [3, 3].
2813- Changed the return type of `ones` and `zeros`: they now return an Array when
2814 arguments are Numbers or an Array, and returns a Matrix when the argument
2815 is a Matrix.
2816- Change matrix index notation in parser from round brackets to square brackets,
2817 for example `A[0, 0:3]`.
2818- Removed the feature introduced in v0.10.0 to automatically convert a complex
2819 value with an imaginary part equal to zero to a number.
2820- Fixed zeros being formatted as null. Thanks @TimKraft.
2821
2822## 2013-07-23, version 0.11.1
2823
2824- Fixed missing development dependency
2825
2826## 2013-07-23, version 0.11.0
2827
2828- Changed math.js from one-based to zero-based indexes.
2829 - Getting and setting matrix subset is now zero-based.
2830 - The dimension argument in function `concat` is now zero-based.
2831- Improvements in the string output of function help.
2832- Added constants `true` and `false`.
2833- Added constructor function `boolean`.
2834- Fixed function `select` not accepting `0` as input.
2835 Thanks Elijah Manor (@elijahmanor).
2836- Parser now supports multiple unary minus operators after each other.
2837- Fixed not accepting empty matrices like `[[], []]`.
2838- Some fixes in the end user documentation.
2839
2840## 2013-07-08, version 0.10.0
2841
2842- For complex calculations, all functions now automatically replace results
2843 having an imaginary part of zero with a Number. (`2i * 2i` now returns a
2844 Number `-4` instead of a Complex `-4 + 0i`).
2845- Implemented support for injecting custom node handlers in the parser. Can be
2846 used for example to implement a node handler for plotting a graph.
2847- Implemented end user documentation and a new `help` function.
2848- Functions `size` and `squeeze` now return a Matrix instead of an Array as
2849 output on Matrix input.
2850- Added a constant tau (2 * pi). Thanks Zak Zibrat (@palimpsests).
2851- Renamed function `unaryminus` to `unary`.
2852- Fixed a bug in determining node dependencies in function assignments.
2853
2854## 2013-06-14, version 0.9.1
2855
2856- Implemented element-wise functions and operators: `emultiply` (`x .* y`),
2857 `edivide` (`x ./ y`), `epow` (`x .^ y`).
2858- Added constants `Infinity` and `NaN`.
2859- Removed support for Workspace to keep the library focused on its core task.
2860- Fixed a bug in the Complex constructor, not accepting NaN values.
2861- Fixed division by zero in case of pure complex values.
2862- Fixed a bug in function multiply multiplying a pure complex value with
2863 Infinity.
2864
2865## 2013-05-29, version 0.9.0
2866
2867- Implemented function `math.parse(expr [,scope])`. Optional parameter scope can
2868 be a plain JavaScript Object containing variables.
2869- Extended function `math.expr(expr [, scope])` with an additional parameter
2870 `scope`, similar to `parse`. Example: `math.eval('x^a', {x:3, a:2});`.
2871- Implemented function `subset`, to get or set a subset from a matrix, string,
2872 or other data types.
2873- Implemented construction functions number and string (mainly useful inside
2874 the parser).
2875- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli).
2876- Moved the parse code from prototype math.expr.Parser to function math.parse,
2877 simplified Parser a little bit.
2878- Strongly simplified the code of Scope and Workspace.
2879- Fixed function mod for negative numerators, and added error messages in case
2880 of wrong input.
2881
2882## 2013-05-18, version 0.8.2
2883
2884- Extended the import function and some other minor improvements.
2885- Fixed a bug in merging one dimensional vectors into a matrix.
2886- Fixed a bug in function subtract, when subtracting a complex number from a
2887 real number.
2888
2889## 2013-05-10, version 0.8.1
2890
2891- Fixed an npm warning when installing mathjs globally.
2892
2893## 2013-05-10, version 0.8.0
2894
2895- Implemented a command line interface. When math.js is installed globally via
2896 npm, the application is available on your system as 'mathjs'.
2897- Implemented `end` keyword for index operator, and added support for implicit
2898 start and end (expressions like `a(2,:)` and `b(2:end,3:end-1)` are supported
2899 now).
2900- Function math.eval is more flexible now: it supports variables and multi-line
2901 expressions.
2902- Removed the read-only option from Parser and Scope.
2903- Fixed non-working unequal operator != in the parser.
2904- Fixed a bug in resizing matrices when replacing a subset.
2905- Fixed a bug in updating a subset of a non-existing variable.
2906- Minor bug fixes.
2907
2908## 2013-05-04, version 0.7.2
2909
2910- Fixed method unequal, which was checking for equality instead of inequality.
2911 Thanks @FJS2.
2912
2913## 2013-04-27, version 0.7.1
2914
2915- Improvements in the parser:
2916 - Added support for chained arguments.
2917 - Added support for chained variable assignments.
2918 - Added a function remove(name) to remove a variable from the parsers scope.
2919 - Renamed nodes for more consistency and to resolve naming conflicts.
2920 - Improved stringification of an expression tree.
2921 - Some simplifications in the code.
2922 - Minor bug fixes.
2923- Fixed a bug in the parser, returning NaN instead of throwing an error for a
2924 number with multiple decimal separators like `2.3.4`.
2925- Fixed a bug in Workspace.insertAfter.
2926- Fixed: math.js now works on IE 6-8 too.
2927
2928## 2013-04-20, version 0.7.0
2929
2930- Implemented method `math.eval`, which uses a readonly parser to evaluate
2931 expressions.
2932- Implemented method `xgcd` (extended eucledian algorithm). Thanks Bart Kiers
2933 (@bkiers).
2934- Improved math.format, which now rounds values to a maximum number of digits
2935 instead of decimals (default is 5 digits, for example `math.format(math.pi)`
2936 returns `3.1416`).
2937- Added examples.
2938- Changed methods square and cube to evaluate matrices element wise (consistent
2939 with all other methods).
2940- Changed second parameter of method import to an object with options.
2941- Fixed method math.typeof on IE.
2942- Minor bug fixes and improvements.
2943
2944## 2013-04-13, version 0.6.0
2945
2946- Implemented chained operations via method math.select(). For example
2947 `math.select(3).add(4).subtract(2).done()` will return `5`.
2948- Implemented methods gcd and lcm.
2949- Implemented method `Unit.in(unit)`, which creates a clone of the unit with a
2950 fixed representation. For example `math.unit('5.08 cm').in('inch')` will
2951 return a unit which string representation always is in inch, thus `2 inch`.
2952 `Unit.in(unit)` is the same as method `math.in(x, unit)`.
2953- Implemented `Unit.toNumber(unit)`, which returns the value of the unit when
2954 represented with given unit. For example
2955 `math.unit('5.08 cm').toNumber('inch')` returns the number `2`, as the
2956 representation of the unit in inches has 2 as value.
2957- Improved: method `math.in(x, unit)` now supports a string as second parameter,
2958 for example `math.in(math.unit('5.08 cm'), 'inch')`.
2959- Split the end user documentation of the parser functions from the source
2960 files.
2961- Removed function help and the built-in documentation from the core library.
2962- Fixed constant i being defined as -1i instead of 1i.
2963- Minor bug fixes.
2964
2965## 2013-04-06, version 0.5.0
2966
2967- Implemented data types Matrix and Range.
2968- Implemented matrix methods clone, concat, det, diag, eye, inv, ones, size,
2969 squeeze, transpose, zeros.
2970- Implemented range operator `:`, and transpose operator `'` in parser.
2971- Changed: created construction methods for easy object creation for all data
2972 types and for the parser. For example, a complex value is now created
2973 with `math.complex(2, 3)` instead of `new math.Complex(2, 3)`, and a parser
2974 is now created with `math.parser()` instead of `new math.parser.Parser()`.
2975- Changed: moved all data types under the namespace math.type, and moved the
2976 Parser, Workspace, etc. under the namespace math.expr.
2977- Changed: changed operator precedence of the power operator:
2978 - it is now right associative instead of left associative like most scripting
2979 languages. So `2^3^4` is now calculated as `2^(3^4)`.
2980 - it has now higher precedence than unary minus most languages, thus `-3^2` is
2981 now calculated as `-(3^2)`.
2982- Changed: renamed the parsers method 'put' into 'set'.
2983- Fixed: method 'in' did not check for units to have the same base.
2984
2985## 2013-03-16, version 0.4.0
2986
2987- Implemented Array support for all methods.
2988- Implemented Array support in the Parser.
2989- Implemented method format.
2990- Implemented parser for units, math.Unit.parse(str).
2991- Improved parser for complex values math.Complex.parse(str);
2992- Improved method help: it now evaluates the examples.
2993- Fixed: a scoping issue with the Parser when defining functions.
2994- Fixed: method 'typeof' was not working well with minified and mangled code.
2995- Fixed: errors in determining the best prefix for a unit.
2996
2997## 2013-03-09, version 0.3.0
2998
2999- Implemented Workspace
3000- Implemented methods cot, csc, sec.
3001- Implemented Array support for methods with one parameter.
3002
3003## 2013-02-25, version 0.2.0
3004
3005- Parser, Scope, and expression tree with Nodes implemented.
3006- Implemented method import which makes it easy to extend math.js.
3007- Implemented methods arg, conj, cube, equal, factorial, im, largereq,
3008 log(x, base), log10, mod, re, sign, smallereq, square, unequal.
3009
3010## 2013-02-18, version 0.1.0
3011
3012- Reached full compatibility with Javascripts built-in Math library.
3013- More functions implemented.
3014- Some bugfixes.
3015
3016## 2013-02-16, version 0.0.2
3017
3018- All constants of Math implemented, plus the imaginary unit i.
3019- Data types Complex and Unit implemented.
3020- First set of functions implemented.
3021
3022## 2013-02-15, version 0.0.1
3023
3024- First publish of the mathjs package. (package is still empty)
3025
\No newline at end of file