UNPKG

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