UNPKG

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