UNPKG

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