UNPKG

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