UNPKG

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