UNPKG

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