UNPKG

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