UNPKG

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