UNPKG

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