UNPKG

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