UNPKG

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