UNPKG

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