UNPKG

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