UNPKG

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