UNPKG

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