UNPKG

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