Released v3.8.0

This commit is contained in:
jos 2016-11-18 19:41:40 +01:00
parent e6a049abe7
commit b866ca3e48
17 changed files with 1452 additions and 1209 deletions

View File

@ -1,7 +1,7 @@
# History
## not yet released, version 3.8.0
## 2016-11-18, version 3.8.0
- Functions `add` and `multiply` now accept more than two arguments. See #739.
- `OperatorNode` now supports more than two arguments. See #739. Thanks @FSMaxB.

View File

@ -1,6 +1,6 @@
{
"name": "mathjs",
"version": "3.7.0",
"version": "3.8.0",
"main": "./dist/math.min.js",
"license": "Apache-2.0",
"ignore": [

View File

@ -1,6 +1,6 @@
{
"name": "mathjs",
"version": "3.7.0",
"version": "3.8.0",
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.",
"repo": "josdejong/mathjs",
"main": "dist/math.min.js",

2549
dist/math.js vendored

File diff suppressed because it is too large Load Diff

2
dist/math.map vendored

File diff suppressed because one or more lines are too long

34
dist/math.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -22,7 +22,7 @@ Function | Description
[math.matrix(x)](functions/matrix.md) | Create a Matrix.
[math.number(value)](functions/number.md) | Create a number or convert a string, boolean, or unit to a number.
[math.sparse(x)](functions/sparse.md) | Create a Sparse Matrix.
[math.splitUnit(unit, parts)](functions/splitUnit.md) | Returns an array of units whose sum is equal to this unit.
[math.splitUnit(unit, parts)](functions/splitUnit.md) | Split a unit in an array of units whose sum is equal to the original unit.
[math.string(value)](functions/string.md) | Create a string or convert any object into a string.
[math.unit(x)](functions/unit.md) | Create a unit.
@ -51,7 +51,7 @@ Function | Description
Function | Description
---- | -----------
[math.abs(x)](functions/abs.md) | Calculate the absolute value of a number.
[math.add(x, y)](functions/add.md) | Add two or multiple values, `x + y`.
[math.add(x, y)](functions/add.md) | Add two or more values, `x + y`.
[math.cbrt(x [, allRoots])](functions/cbrt.md) | Calculate the cubic root of a value.
[math.ceil(x)](functions/ceil.md) | Round a value towards plus infinity If `x` is complex, both real and imaginary part are rounded towards plus infinity.
[math.cube(x)](functions/cube.md) | Compute the cube of a value, `x * x * x`.
@ -68,7 +68,7 @@ Function | Description
[math.log(x [, base])](functions/log.md) | Calculate the logarithm of a value.
[math.log10(x)](functions/log10.md) | Calculate the 10-base logarithm of a value.
[math.mod(x, y)](functions/mod.md) | Calculates the modulus, the remainder of an integer division.
[math.multiply(x, y)](functions/multiply.md) | Multiply two or multiple values, `x * y`.
[math.multiply(x, y)](functions/multiply.md) | Multiply two or more values, `x * y`.
[math.norm(x [, p])](functions/norm.md) | Calculate the norm of a number, vector or matrix.
[math.nthRoot(a)](functions/nthRoot.md) | Calculate the nth root of a value.
[math.pow(x, y)](functions/pow.md) | Calculates the power of x to y, `x ^ y`.

View File

@ -2,7 +2,7 @@
# Function add
Add two or multiple values, `x + y`.
Add two or more values, `x + y`.
For matrices, the function is evaluated element wise.
@ -31,6 +31,7 @@ number | BigNumber | Fraction | Complex | Unit | Array
```js
math.add(2, 3); // returns number 5
math.add(2, 3, 4); // returns number 9
var a = math.complex(2, 3);
var b = math.complex(-4, 1);
@ -48,4 +49,5 @@ math.add("2.3", "4"); // returns number 6.3
## See also
[subtract](subtract.md)
[subtract](subtract.md),
[sum](sum.md)

View File

@ -42,7 +42,7 @@ Unit | The new unit
```js
math.createUnit('foo');
math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts]});
math.createUnit('knot', {definition: '0.514444444 m/s', aliases: ['knots', 'kt', 'kts']});
math.createUnit('mph', '1 mile/hour');
```

View File

@ -2,7 +2,7 @@
# Function multiply
Multiply two or multiple values, `x * y`.
Multiply two or more values, `x * y`.
For matrices, the matrix product is calculated.
@ -31,6 +31,7 @@ number | BigNumber | Fraction | Complex | Unit | Array
```js
math.multiply(4, 5.2); // returns number 20.8
math.multiply(2, 3, 4); // returns number 24
var a = math.complex(2, 3);
var b = math.complex(4, 1);
@ -47,4 +48,7 @@ math.multiply(3, e); // returns Unit 6.3 km
## See also
[divide](divide.md)
[divide](divide.md),
[prod](prod.md),
[cross](cross.md),
[dot](dot.md)

View File

@ -2,7 +2,7 @@
# Function splitUnit
Returns an array of units whose sum is equal to this unit
Split a unit in an array of units whose sum is equal to the original unit.
## Syntax
@ -27,7 +27,7 @@ Array | An array of units.
## Examples
```js
splitUnit(new Unit(1, 'm'), ['feet', 'inch']);
math.splitUnit(new Unit(1, 'm'), ['feet', 'inch']);
// [ 3 feet, 3.3700787401575 inch ]
```

View File

@ -0,0 +1,18 @@
module.exports = {
'name': 'createUnit',
'category': 'Construction',
'syntax': [
'createUnit(definitions)',
'createUnit(name, definition)'
],
'description':
'Create a user-defined unit and register it with the Unit type.',
'examples': [
'createUnit("foo")',
'createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})',
'createUnit("mph", "1 mile/hour")'
],
'seealso': [
'unit', 'splitUnit'
]
};

View File

@ -0,0 +1,15 @@
module.exports = {
'name': 'splitUnit',
'category': 'Construction',
'syntax': [
'splitUnit(unit: Unit, parts: Unit[])'
],
'description':
'Split a unit in an array of units whose sum is equal to the original unit.',
'examples': [
'splitUnit(1 m, ["feet", "inch"])'
],
'seealso': [
'unit', 'createUnit'
]
};

View File

@ -6,11 +6,13 @@ function factory (construction, config, load, typed) {
docs.bignumber = require('./construction/bignumber');
docs['boolean'] = require('./construction/boolean');
docs.complex = require('./construction/complex');
docs.createUnit = require('./construction/createUnit');
docs.fraction = require('./construction/fraction');
docs.index = require('./construction/index');
docs.matrix = require('./construction/matrix');
docs.number = require('./construction/number');
docs.sparse = require('./construction/sparse');
docs.splitUnit = require('./construction/splitUnit');
docs.string = require('./construction/string');
docs.unit = require('./construction/unit');

View File

@ -5,7 +5,7 @@ var deepMap = require('../../../utils/collection/deepMap');
function factory (type, config, load, typed) {
/**
* Returns an array of units whose sum is equal to this unit
* Split a unit in an array of units whose sum is equal to the original unit.
*
* Syntax:
*
@ -13,7 +13,7 @@ function factory (type, config, load, typed) {
*
* Example:
*
* splitUnit(new Unit(1, 'm'), ['feet', 'inch']);
* math.splitUnit(new Unit(1, 'm'), ['feet', 'inch']);
* // [ 3 feet, 3.3700787401575 inch ]
*
* See also:
@ -23,7 +23,6 @@ function factory (type, config, load, typed) {
* @param {Array} [parts] An array of strings or valueless units.
* @return {Array} An array of units.
*/
var splitUnit = typed('splitUnit', {
'Unit, Array': function(unit, parts) {
return unit.splitUnit(parts);

View File

@ -1,3 +1,3 @@
module.exports = '3.7.0';
module.exports = '3.8.0';
// Note: This file is automatically generated when building math.js.
// Changes made in this file will be overwritten.

View File

@ -1,6 +1,6 @@
{
"name": "mathjs",
"version": "3.7.0",
"version": "3.8.0",
"description": "Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.",
"author": "Jos de Jong <wjosdejong@gmail.com> (https://github.com/josdejong)",
"contributors": [