UNPKG

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