UNPKG

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