UNPKG

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