UNPKG

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