UNPKG

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