feat:node-modules

This commit is contained in:
houjunxiang
2025-11-24 10:26:18 +08:00
parent 753766893b
commit 8a3e48d856
8825 changed files with 567399 additions and 1 deletions

138
node_modules/mathjs/lib/cjs/expression/Help.js generated vendored Normal file
View File

@@ -0,0 +1,138 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createHelpClass = void 0;
var _is = require("../utils/is.js");
var _object = require("../utils/object.js");
var _string = require("../utils/string.js");
var _factory = require("../utils/factory.js");
const name = 'Help';
const dependencies = ['evaluate'];
const createHelpClass = exports.createHelpClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
let {
evaluate
} = _ref;
/**
* Documentation object
* @param {Object} doc Object containing properties:
* {string} name
* {string} category
* {string} description
* {string[]} syntax
* {string[]} examples
* {string[]} seealso
* @constructor
*/
function Help(doc) {
if (!(this instanceof Help)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
if (!doc) throw new Error('Argument "doc" missing');
this.doc = doc;
}
/**
* Attach type information
*/
Help.prototype.type = 'Help';
Help.prototype.isHelp = true;
/**
* Generate a string representation of the Help object
* @return {string} Returns a string
* @private
*/
Help.prototype.toString = function () {
const doc = this.doc || {};
let desc = '\n';
if (doc.name) {
desc += 'Name: ' + doc.name + '\n\n';
}
if (doc.category) {
desc += 'Category: ' + doc.category + '\n\n';
}
if (doc.description) {
desc += 'Description:\n ' + doc.description + '\n\n';
}
if (doc.syntax) {
desc += 'Syntax:\n ' + doc.syntax.join('\n ') + '\n\n';
}
if (doc.examples) {
desc += 'Examples:\n';
// after evaluating the examples, we restore config in case the examples
// did change the config.
let configChanged = false;
const originalConfig = evaluate('config()');
const scope = {
config: newConfig => {
configChanged = true;
return evaluate('config(newConfig)', {
newConfig
});
}
};
for (let i = 0; i < doc.examples.length; i++) {
const expr = doc.examples[i];
desc += ' ' + expr + '\n';
let res;
try {
// note: res can be undefined when `expr` is an empty string
res = evaluate(expr, scope);
} catch (e) {
res = e;
}
if (res !== undefined && !(0, _is.isHelp)(res)) {
desc += ' ' + (0, _string.format)(res, {
precision: 14
}) + '\n';
}
}
desc += '\n';
if (configChanged) {
evaluate('config(originalConfig)', {
originalConfig
});
}
}
if (doc.mayThrow && doc.mayThrow.length) {
desc += 'Throws: ' + doc.mayThrow.join(', ') + '\n\n';
}
if (doc.seealso && doc.seealso.length) {
desc += 'See also: ' + doc.seealso.join(', ') + '\n';
}
return desc;
};
/**
* Export the help object to JSON
*/
Help.prototype.toJSON = function () {
const obj = (0, _object.clone)(this.doc);
obj.mathjs = 'Help';
return obj;
};
/**
* Instantiate a Help object from a JSON object
* @param {Object} json
* @returns {Help} Returns a new Help object
*/
Help.fromJSON = function (json) {
const doc = {};
Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {
doc[prop] = json[prop];
});
return new Help(doc);
};
/**
* Returns a string representation of the Help object
*/
Help.prototype.valueOf = Help.prototype.toString;
return Help;
}, {
isClass: true
});

166
node_modules/mathjs/lib/cjs/expression/Parser.js generated vendored Normal file
View File

@@ -0,0 +1,166 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createParserClass = void 0;
var _factory = require("../utils/factory.js");
var _map = require("../utils/map.js");
const name = 'Parser';
const dependencies = ['evaluate', 'parse'];
const createParserClass = exports.createParserClass = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
let {
evaluate,
parse
} = _ref;
/**
* @constructor Parser
* Parser contains methods to evaluate or parse expressions, and has a number
* of convenience methods to get, set, and remove variables from memory. Parser
* keeps a scope containing variables in memory, which is used for all
* evaluations.
*
* Methods:
* const result = parser.evaluate(expr) // evaluate an expression
* const value = parser.get(name) // retrieve a variable from the parser
* const values = parser.getAll() // retrieve all defined variables
* parser.set(name, value) // set a variable in the parser
* parser.remove(name) // clear a variable from the
* // parsers scope
* parser.clear() // clear the parsers scope
*
* Example usage:
* const parser = new Parser()
* // Note: there is a convenience method which can be used instead:
* // const parser = new math.parser()
*
* // evaluate expressions
* parser.evaluate('sqrt(3^2 + 4^2)') // 5
* parser.evaluate('sqrt(-4)') // 2i
* parser.evaluate('2 inch in cm') // 5.08 cm
* parser.evaluate('cos(45 deg)') // 0.7071067811865476
*
* // define variables and functions
* parser.evaluate('x = 7 / 2') // 3.5
* parser.evaluate('x + 3') // 6.5
* parser.evaluate('f(x, y) = x^y') // f(x, y)
* parser.evaluate('f(2, 3)') // 8
*
* // get and set variables and functions
* const x = parser.get('x') // 3.5
* const f = parser.get('f') // function
* const g = f(3, 2) // 9
* parser.set('h', 500)
* const i = parser.evaluate('h / 2') // 250
* parser.set('hello', function (name) {
* return 'hello, ' + name + '!'
* })
* parser.evaluate('hello("user")') // "hello, user!"
*
* // clear defined functions and variables
* parser.clear()
*
*/
function Parser() {
if (!(this instanceof Parser)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
Object.defineProperty(this, 'scope', {
value: (0, _map.createEmptyMap)(),
writable: false
});
}
/**
* Attach type information
*/
Parser.prototype.type = 'Parser';
Parser.prototype.isParser = true;
/**
* Parse and evaluate the given expression
* @param {string | string[]} expr A string containing an expression,
* for example "2+3", or a list with expressions
* @return {*} result The result, or undefined when the expression was empty
* @throws {Error}
*/
Parser.prototype.evaluate = function (expr) {
// TODO: validate arguments
return evaluate(expr, this.scope);
};
/**
* Get a variable (a function or variable) by name from the parsers scope.
* Returns undefined when not found
* @param {string} name
* @return {* | undefined} value
*/
Parser.prototype.get = function (name) {
// TODO: validate arguments
if (this.scope.has(name)) {
return this.scope.get(name);
}
};
/**
* Get a map with all defined variables
* @return {Object} values
*/
Parser.prototype.getAll = function () {
return (0, _map.toObject)(this.scope);
};
/**
* Get a map with all defined variables
* @return {Map} values
*/
Parser.prototype.getAllAsMap = function () {
return this.scope;
};
function isValidVariableName(name) {
if (name.length === 0) {
return false;
}
for (let i = 0; i < name.length; i++) {
const cPrev = name.charAt(i - 1);
const c = name.charAt(i);
const cNext = name.charAt(i + 1);
const valid = parse.isAlpha(c, cPrev, cNext) || i > 0 && parse.isDigit(c);
if (!valid) {
return false;
}
}
return true;
}
/**
* Set a symbol (a function or variable) by name from the parsers scope.
* @param {string} name
* @param {* | undefined} value
*/
Parser.prototype.set = function (name, value) {
if (!isValidVariableName(name)) {
throw new Error(`Invalid variable name: '${name}'. Variable names must follow the specified rules.`);
}
this.scope.set(name, value);
return value;
};
/**
* Remove a variable from the parsers scope
* @param {string} name
*/
Parser.prototype.remove = function (name) {
this.scope.delete(name);
};
/**
* Clear the scope with variables and functions
*/
Parser.prototype.clear = function () {
this.scope.clear();
};
return Parser;
}, {
isClass: true
});

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.InfinityDocs = void 0;
const InfinityDocs = exports.InfinityDocs = {
name: 'Infinity',
category: 'Constants',
syntax: ['Infinity'],
description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',
examples: ['Infinity', '1 / 0'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LN10Docs = void 0;
const LN10Docs = exports.LN10Docs = {
name: 'LN10',
category: 'Constants',
syntax: ['LN10'],
description: 'Returns the natural logarithm of 10, approximately equal to 2.302',
examples: ['LN10', 'log(10)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LN2Docs = void 0;
const LN2Docs = exports.LN2Docs = {
name: 'LN2',
category: 'Constants',
syntax: ['LN2'],
description: 'Returns the natural logarithm of 2, approximately equal to 0.693',
examples: ['LN2', 'log(2)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LOG10EDocs = void 0;
const LOG10EDocs = exports.LOG10EDocs = {
name: 'LOG10E',
category: 'Constants',
syntax: ['LOG10E'],
description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',
examples: ['LOG10E', 'log(e, 10)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.LOG2EDocs = void 0;
const LOG2EDocs = exports.LOG2EDocs = {
name: 'LOG2E',
category: 'Constants',
syntax: ['LOG2E'],
description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',
examples: ['LOG2E', 'log(e, 2)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NaNDocs = void 0;
const NaNDocs = exports.NaNDocs = {
name: 'NaN',
category: 'Constants',
syntax: ['NaN'],
description: 'Not a number',
examples: ['NaN', '0 / 0'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SQRT12Docs = void 0;
const SQRT12Docs = exports.SQRT12Docs = {
name: 'SQRT1_2',
category: 'Constants',
syntax: ['SQRT1_2'],
description: 'Returns the square root of 1/2, approximately equal to 0.707',
examples: ['SQRT1_2', 'sqrt(1/2)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SQRT2Docs = void 0;
const SQRT2Docs = exports.SQRT2Docs = {
name: 'SQRT2',
category: 'Constants',
syntax: ['SQRT2'],
description: 'Returns the square root of 2, approximately equal to 1.414',
examples: ['SQRT2', 'sqrt(2)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.eDocs = void 0;
const eDocs = exports.eDocs = {
name: 'e',
category: 'Constants',
syntax: ['e'],
description: 'Euler\'s number, the base of the natural logarithm. Approximately equal to 2.71828',
examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],
seealso: ['exp']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.falseDocs = void 0;
const falseDocs = exports.falseDocs = {
name: 'false',
category: 'Constants',
syntax: ['false'],
description: 'Boolean value false',
examples: ['false'],
seealso: ['true']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.iDocs = void 0;
const iDocs = exports.iDocs = {
name: 'i',
category: 'Constants',
syntax: ['i'],
description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',
examples: ['i', 'i * i', 'sqrt(-1)'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.nullDocs = void 0;
const nullDocs = exports.nullDocs = {
name: 'null',
category: 'Constants',
syntax: ['null'],
description: 'Value null',
examples: ['null'],
seealso: ['true', 'false']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.phiDocs = void 0;
const phiDocs = exports.phiDocs = {
name: 'phi',
category: 'Constants',
syntax: ['phi'],
description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',
examples: ['phi'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.piDocs = void 0;
const piDocs = exports.piDocs = {
name: 'pi',
category: 'Constants',
syntax: ['pi'],
description: 'The number pi is a mathematical constant that is the ratio of a circle\'s circumference to its diameter, and is approximately equal to 3.14159',
examples: ['pi', 'sin(pi/2)'],
seealso: ['tau']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.tauDocs = void 0;
const tauDocs = exports.tauDocs = {
name: 'tau',
category: 'Constants',
syntax: ['tau'],
description: 'Tau is the ratio constant of a circle\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',
examples: ['tau', '2 * pi'],
seealso: ['pi']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.trueDocs = void 0;
const trueDocs = exports.trueDocs = {
name: 'true',
category: 'Constants',
syntax: ['true'],
description: 'Boolean value true',
examples: ['true'],
seealso: ['false']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.versionDocs = void 0;
const versionDocs = exports.versionDocs = {
name: 'version',
category: 'Constants',
syntax: ['version'],
description: 'A string with the version number of math.js',
examples: ['version'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bigintDocs = void 0;
const bigintDocs = exports.bigintDocs = {
name: 'bigint',
category: 'Construction',
syntax: ['bigint(x)'],
description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',
examples: ['123123123123123123 # a large number will lose digits', 'bigint("123123123123123123")', 'bignumber(["1", "3", "5"])'],
seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bignumberDocs = void 0;
const bignumberDocs = exports.bignumberDocs = {
name: 'bignumber',
category: 'Construction',
syntax: ['bignumber(x)'],
description: 'Create a big number from a number or string.',
examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber("7.2")', 'bignumber("7.2e500")', 'bignumber([0.1, 0.2, 0.3])'],
seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.booleanDocs = void 0;
const booleanDocs = exports.booleanDocs = {
name: 'boolean',
category: 'Construction',
syntax: ['x', 'boolean(x)'],
description: 'Convert a string or number into a boolean.',
examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean("true")', 'boolean("false")', 'boolean([1, 0, 1, 1])'],
seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.complexDocs = void 0;
const complexDocs = exports.complexDocs = {
name: 'complex',
category: 'Construction',
syntax: ['complex()', 'complex(re, im)', 'complex(string)'],
description: 'Create a complex number.',
examples: ['complex()', 'complex(2, 3)', 'complex("7 - 2i")'],
seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createUnitDocs = void 0;
const createUnitDocs = exports.createUnitDocs = {
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,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fractionDocs = void 0;
const fractionDocs = exports.fractionDocs = {
name: 'fraction',
category: 'Construction',
syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],
description: 'Create a fraction from a number or from integer numerator and denominator.',
examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],
seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.indexDocs = void 0;
const indexDocs = exports.indexDocs = {
name: 'index',
category: 'Construction',
syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],
description: 'Create an index to get or replace a subset of a matrix',
examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'],
seealso: ['bignumber', 'boolean', 'complex', 'matrix,', 'number', 'range', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.matrixDocs = void 0;
const matrixDocs = exports.matrixDocs = {
name: 'matrix',
category: 'Construction',
syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix("dense")', 'matrix([...])'],
description: 'Create a matrix.',
examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], "sparse")', 'matrix([3, 4; 5, 6], "sparse", "number")'],
seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.numberDocs = void 0;
const numberDocs = exports.numberDocs = {
name: 'number',
category: 'Construction',
syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],
description: 'Create a number or convert a string or boolean into a number.',
examples: ['2', '2e3', '4.05', 'number(2)', 'number("7.2")', 'number(true)', 'number([true, false, true, true])', 'number(unit("52cm"), "m")'],
seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sparseDocs = void 0;
const sparseDocs = exports.sparseDocs = {
name: 'sparse',
category: 'Construction',
syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], "number")'],
description: 'Create a sparse matrix.',
examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], "number")'],
seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.splitUnitDocs = void 0;
const splitUnitDocs = exports.splitUnitDocs = {
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

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.stringDocs = void 0;
const stringDocs = exports.stringDocs = {
name: 'string',
category: 'Construction',
syntax: ['"text"', 'string(x)'],
description: 'Create a string or convert a value to a string',
examples: ['"Hello World!"', 'string(4.2)', 'string(3 + 2i)'],
seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unitDocs = void 0;
const unitDocs = exports.unitDocs = {
name: 'unit',
category: 'Construction',
syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],
description: 'Create a unit.',
examples: ['5.5 mm', '3 inch', 'unit(7.1, "kilogram")', 'unit("23 deg")'],
seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.configDocs = void 0;
const configDocs = exports.configDocs = {
name: 'config',
category: 'Core',
syntax: ['config()', 'config(options)'],
description: 'Get configuration or change configuration.',
examples: ['config()', '1/3 + 1/4', 'config({number: "Fraction"})', '1/3 + 1/4'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.importDocs = void 0;
const importDocs = exports.importDocs = {
name: 'import',
category: 'Core',
syntax: ['import(functions)', 'import(functions, options)'],
description: 'Import functions or constants from an object.',
examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],
seealso: []
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.typedDocs = void 0;
const typedDocs = exports.typedDocs = {
name: 'typed',
category: 'Core',
syntax: ['typed(signatures)', 'typed(name, signatures)'],
description: 'Create a typed function.',
examples: ['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })', 'double(2)', 'double("hello")'],
seealso: []
};

View File

@@ -0,0 +1,726 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.embeddedDocs = void 0;
var _e = require("./constants/e.js");
var _false = require("./constants/false.js");
var _i = require("./constants/i.js");
var _Infinity = require("./constants/Infinity.js");
var _LN = require("./constants/LN10.js");
var _LN2 = require("./constants/LN2.js");
var _LOG10E = require("./constants/LOG10E.js");
var _LOG2E = require("./constants/LOG2E.js");
var _NaN = require("./constants/NaN.js");
var _null = require("./constants/null.js");
var _phi = require("./constants/phi.js");
var _pi = require("./constants/pi.js");
var _SQRT1_ = require("./constants/SQRT1_2.js");
var _SQRT = require("./constants/SQRT2.js");
var _tau = require("./constants/tau.js");
var _true = require("./constants/true.js");
var _version = require("./constants/version.js");
var _bignumber = require("./construction/bignumber.js");
var _bigint = require("./construction/bigint.js");
var _boolean = require("./construction/boolean.js");
var _complex = require("./construction/complex.js");
var _createUnit = require("./construction/createUnit.js");
var _fraction = require("./construction/fraction.js");
var _index = require("./construction/index.js");
var _matrix = require("./construction/matrix.js");
var _number = require("./construction/number.js");
var _sparse = require("./construction/sparse.js");
var _splitUnit = require("./construction/splitUnit.js");
var _string = require("./construction/string.js");
var _unit = require("./construction/unit.js");
var _config = require("./core/config.js");
var _import = require("./core/import.js");
var _typed = require("./core/typed.js");
var _derivative = require("./function/algebra/derivative.js");
var _leafCount = require("./function/algebra/leafCount.js");
var _lsolve = require("./function/algebra/lsolve.js");
var _lsolveAll = require("./function/algebra/lsolveAll.js");
var _lup = require("./function/algebra/lup.js");
var _lusolve = require("./function/algebra/lusolve.js");
var _polynomialRoot = require("./function/algebra/polynomialRoot.js");
var _qr = require("./function/algebra/qr.js");
var _rationalize = require("./function/algebra/rationalize.js");
var _resolve = require("./function/algebra/resolve.js");
var _simplify = require("./function/algebra/simplify.js");
var _simplifyConstant = require("./function/algebra/simplifyConstant.js");
var _simplifyCore = require("./function/algebra/simplifyCore.js");
var _slu = require("./function/algebra/slu.js");
var _symbolicEqual = require("./function/algebra/symbolicEqual.js");
var _usolve = require("./function/algebra/usolve.js");
var _usolveAll = require("./function/algebra/usolveAll.js");
var _abs = require("./function/arithmetic/abs.js");
var _add = require("./function/arithmetic/add.js");
var _cbrt = require("./function/arithmetic/cbrt.js");
var _ceil = require("./function/arithmetic/ceil.js");
var _cube = require("./function/arithmetic/cube.js");
var _divide = require("./function/arithmetic/divide.js");
var _dotDivide = require("./function/arithmetic/dotDivide.js");
var _dotMultiply = require("./function/arithmetic/dotMultiply.js");
var _dotPow = require("./function/arithmetic/dotPow.js");
var _exp = require("./function/arithmetic/exp.js");
var _expm = require("./function/arithmetic/expm.js");
var _expm2 = require("./function/arithmetic/expm1.js");
var _fix = require("./function/arithmetic/fix.js");
var _floor = require("./function/arithmetic/floor.js");
var _gcd = require("./function/arithmetic/gcd.js");
var _hypot = require("./function/arithmetic/hypot.js");
var _invmod = require("./function/arithmetic/invmod.js");
var _lcm = require("./function/arithmetic/lcm.js");
var _log = require("./function/arithmetic/log.js");
var _log2 = require("./function/arithmetic/log10.js");
var _log1p = require("./function/arithmetic/log1p.js");
var _log3 = require("./function/arithmetic/log2.js");
var _mod = require("./function/arithmetic/mod.js");
var _multiply = require("./function/arithmetic/multiply.js");
var _norm = require("./function/arithmetic/norm.js");
var _nthRoot = require("./function/arithmetic/nthRoot.js");
var _nthRoots = require("./function/arithmetic/nthRoots.js");
var _pow = require("./function/arithmetic/pow.js");
var _round = require("./function/arithmetic/round.js");
var _sign = require("./function/arithmetic/sign.js");
var _sqrt = require("./function/arithmetic/sqrt.js");
var _sqrtm = require("./function/arithmetic/sqrtm.js");
var _sylvester = require("./function/algebra/sylvester.js");
var _schur = require("./function/algebra/schur.js");
var _lyap = require("./function/algebra/lyap.js");
var _square = require("./function/arithmetic/square.js");
var _subtract = require("./function/arithmetic/subtract.js");
var _unaryMinus = require("./function/arithmetic/unaryMinus.js");
var _unaryPlus = require("./function/arithmetic/unaryPlus.js");
var _xgcd = require("./function/arithmetic/xgcd.js");
var _bitAnd = require("./function/bitwise/bitAnd.js");
var _bitNot = require("./function/bitwise/bitNot.js");
var _bitOr = require("./function/bitwise/bitOr.js");
var _bitXor = require("./function/bitwise/bitXor.js");
var _leftShift = require("./function/bitwise/leftShift.js");
var _rightArithShift = require("./function/bitwise/rightArithShift.js");
var _rightLogShift = require("./function/bitwise/rightLogShift.js");
var _bellNumbers = require("./function/combinatorics/bellNumbers.js");
var _catalan = require("./function/combinatorics/catalan.js");
var _composition = require("./function/combinatorics/composition.js");
var _stirlingS = require("./function/combinatorics/stirlingS2.js");
var _arg = require("./function/complex/arg.js");
var _conj = require("./function/complex/conj.js");
var _im = require("./function/complex/im.js");
var _re = require("./function/complex/re.js");
var _evaluate = require("./function/expression/evaluate.js");
var _help = require("./function/expression/help.js");
var _distance = require("./function/geometry/distance.js");
var _intersect = require("./function/geometry/intersect.js");
var _and = require("./function/logical/and.js");
var _not = require("./function/logical/not.js");
var _or = require("./function/logical/or.js");
var _xor = require("./function/logical/xor.js");
var _column = require("./function/matrix/column.js");
var _concat = require("./function/matrix/concat.js");
var _count = require("./function/matrix/count.js");
var _cross = require("./function/matrix/cross.js");
var _ctranspose = require("./function/matrix/ctranspose.js");
var _det = require("./function/matrix/det.js");
var _diag = require("./function/matrix/diag.js");
var _diff = require("./function/matrix/diff.js");
var _dot = require("./function/matrix/dot.js");
var _eigs = require("./function/matrix/eigs.js");
var _filter = require("./function/matrix/filter.js");
var _flatten = require("./function/matrix/flatten.js");
var _forEach = require("./function/matrix/forEach.js");
var _getMatrixDataType = require("./function/matrix/getMatrixDataType.js");
var _identity = require("./function/matrix/identity.js");
var _inv = require("./function/matrix/inv.js");
var _pinv = require("./function/matrix/pinv.js");
var _kron = require("./function/matrix/kron.js");
var _map = require("./function/matrix/map.js");
var _matrixFromColumns = require("./function/matrix/matrixFromColumns.js");
var _matrixFromFunction = require("./function/matrix/matrixFromFunction.js");
var _matrixFromRows = require("./function/matrix/matrixFromRows.js");
var _ones = require("./function/matrix/ones.js");
var _partitionSelect = require("./function/matrix/partitionSelect.js");
var _range = require("./function/matrix/range.js");
var _reshape = require("./function/matrix/reshape.js");
var _resize = require("./function/matrix/resize.js");
var _rotate = require("./function/matrix/rotate.js");
var _rotationMatrix = require("./function/matrix/rotationMatrix.js");
var _row = require("./function/matrix/row.js");
var _size = require("./function/matrix/size.js");
var _sort = require("./function/matrix/sort.js");
var _squeeze = require("./function/matrix/squeeze.js");
var _subset = require("./function/matrix/subset.js");
var _trace = require("./function/matrix/trace.js");
var _transpose = require("./function/matrix/transpose.js");
var _zeros = require("./function/matrix/zeros.js");
var _fft = require("./function/matrix/fft.js");
var _ifft = require("./function/matrix/ifft.js");
var _combinations = require("./function/probability/combinations.js");
var _combinationsWithRep = require("./function/probability/combinationsWithRep.js");
var _factorial = require("./function/probability/factorial.js");
var _gamma = require("./function/probability/gamma.js");
var _lgamma = require("./function/probability/lgamma.js");
var _kldivergence = require("./function/probability/kldivergence.js");
var _multinomial = require("./function/probability/multinomial.js");
var _permutations = require("./function/probability/permutations.js");
var _pickRandom = require("./function/probability/pickRandom.js");
var _random = require("./function/probability/random.js");
var _randomInt = require("./function/probability/randomInt.js");
var _compare = require("./function/relational/compare.js");
var _compareNatural = require("./function/relational/compareNatural.js");
var _compareText = require("./function/relational/compareText.js");
var _deepEqual = require("./function/relational/deepEqual.js");
var _equal = require("./function/relational/equal.js");
var _equalText = require("./function/relational/equalText.js");
var _larger = require("./function/relational/larger.js");
var _largerEq = require("./function/relational/largerEq.js");
var _smaller = require("./function/relational/smaller.js");
var _smallerEq = require("./function/relational/smallerEq.js");
var _unequal = require("./function/relational/unequal.js");
var _setCartesian = require("./function/set/setCartesian.js");
var _setDifference = require("./function/set/setDifference.js");
var _setDistinct = require("./function/set/setDistinct.js");
var _setIntersect = require("./function/set/setIntersect.js");
var _setIsSubset = require("./function/set/setIsSubset.js");
var _setMultiplicity = require("./function/set/setMultiplicity.js");
var _setPowerset = require("./function/set/setPowerset.js");
var _setSize = require("./function/set/setSize.js");
var _setSymDifference = require("./function/set/setSymDifference.js");
var _setUnion = require("./function/set/setUnion.js");
var _zpk2tf = require("./function/signal/zpk2tf.js");
var _freqz = require("./function/signal/freqz.js");
var _erf = require("./function/special/erf.js");
var _zeta = require("./function/special/zeta.js");
var _mad = require("./function/statistics/mad.js");
var _max = require("./function/statistics/max.js");
var _mean = require("./function/statistics/mean.js");
var _median = require("./function/statistics/median.js");
var _min = require("./function/statistics/min.js");
var _mode = require("./function/statistics/mode.js");
var _prod = require("./function/statistics/prod.js");
var _quantileSeq = require("./function/statistics/quantileSeq.js");
var _std = require("./function/statistics/std.js");
var _cumsum = require("./function/statistics/cumsum.js");
var _sum = require("./function/statistics/sum.js");
var _variance = require("./function/statistics/variance.js");
var _corr = require("./function/statistics/corr.js");
var _acos = require("./function/trigonometry/acos.js");
var _acosh = require("./function/trigonometry/acosh.js");
var _acot = require("./function/trigonometry/acot.js");
var _acoth = require("./function/trigonometry/acoth.js");
var _acsc = require("./function/trigonometry/acsc.js");
var _acsch = require("./function/trigonometry/acsch.js");
var _asec = require("./function/trigonometry/asec.js");
var _asech = require("./function/trigonometry/asech.js");
var _asin = require("./function/trigonometry/asin.js");
var _asinh = require("./function/trigonometry/asinh.js");
var _atan = require("./function/trigonometry/atan.js");
var _atan2 = require("./function/trigonometry/atan2.js");
var _atanh = require("./function/trigonometry/atanh.js");
var _cos = require("./function/trigonometry/cos.js");
var _cosh = require("./function/trigonometry/cosh.js");
var _cot = require("./function/trigonometry/cot.js");
var _coth = require("./function/trigonometry/coth.js");
var _csc = require("./function/trigonometry/csc.js");
var _csch = require("./function/trigonometry/csch.js");
var _sec = require("./function/trigonometry/sec.js");
var _sech = require("./function/trigonometry/sech.js");
var _sin = require("./function/trigonometry/sin.js");
var _sinh = require("./function/trigonometry/sinh.js");
var _tan = require("./function/trigonometry/tan.js");
var _tanh = require("./function/trigonometry/tanh.js");
var _to = require("./function/units/to.js");
var _bin = require("./function/utils/bin.js");
var _clone = require("./function/utils/clone.js");
var _format = require("./function/utils/format.js");
var _hasNumericValue = require("./function/utils/hasNumericValue.js");
var _hex = require("./function/utils/hex.js");
var _isInteger = require("./function/utils/isInteger.js");
var _isNaN = require("./function/utils/isNaN.js");
var _isNegative = require("./function/utils/isNegative.js");
var _isNumeric = require("./function/utils/isNumeric.js");
var _isPositive = require("./function/utils/isPositive.js");
var _isPrime = require("./function/utils/isPrime.js");
var _isZero = require("./function/utils/isZero.js");
var _numeric = require("./function/utils/numeric.js");
var _oct = require("./function/utils/oct.js");
var _print = require("./function/utils/print.js");
var _typeOf = require("./function/utils/typeOf.js");
var _solveODE = require("./function/numeric/solveODE.js");
const embeddedDocs = exports.embeddedDocs = {
// construction functions
bignumber: _bignumber.bignumberDocs,
bigint: _bigint.bigintDocs,
boolean: _boolean.booleanDocs,
complex: _complex.complexDocs,
createUnit: _createUnit.createUnitDocs,
fraction: _fraction.fractionDocs,
index: _index.indexDocs,
matrix: _matrix.matrixDocs,
number: _number.numberDocs,
sparse: _sparse.sparseDocs,
splitUnit: _splitUnit.splitUnitDocs,
string: _string.stringDocs,
unit: _unit.unitDocs,
// constants
e: _e.eDocs,
E: _e.eDocs,
false: _false.falseDocs,
i: _i.iDocs,
Infinity: _Infinity.InfinityDocs,
LN2: _LN2.LN2Docs,
LN10: _LN.LN10Docs,
LOG2E: _LOG2E.LOG2EDocs,
LOG10E: _LOG10E.LOG10EDocs,
NaN: _NaN.NaNDocs,
null: _null.nullDocs,
pi: _pi.piDocs,
PI: _pi.piDocs,
phi: _phi.phiDocs,
SQRT1_2: _SQRT1_.SQRT12Docs,
SQRT2: _SQRT.SQRT2Docs,
tau: _tau.tauDocs,
true: _true.trueDocs,
version: _version.versionDocs,
// physical constants
// TODO: more detailed docs for physical constants
speedOfLight: {
description: 'Speed of light in vacuum',
examples: ['speedOfLight']
},
gravitationConstant: {
description: 'Newtonian constant of gravitation',
examples: ['gravitationConstant']
},
planckConstant: {
description: 'Planck constant',
examples: ['planckConstant']
},
reducedPlanckConstant: {
description: 'Reduced Planck constant',
examples: ['reducedPlanckConstant']
},
magneticConstant: {
description: 'Magnetic constant (vacuum permeability)',
examples: ['magneticConstant']
},
electricConstant: {
description: 'Electric constant (vacuum permeability)',
examples: ['electricConstant']
},
vacuumImpedance: {
description: 'Characteristic impedance of vacuum',
examples: ['vacuumImpedance']
},
coulomb: {
description: 'Coulomb\'s constant',
examples: ['coulomb']
},
elementaryCharge: {
description: 'Elementary charge',
examples: ['elementaryCharge']
},
bohrMagneton: {
description: 'Bohr magneton',
examples: ['bohrMagneton']
},
conductanceQuantum: {
description: 'Conductance quantum',
examples: ['conductanceQuantum']
},
inverseConductanceQuantum: {
description: 'Inverse conductance quantum',
examples: ['inverseConductanceQuantum']
},
// josephson: {description: 'Josephson constant', examples: ['josephson']},
magneticFluxQuantum: {
description: 'Magnetic flux quantum',
examples: ['magneticFluxQuantum']
},
nuclearMagneton: {
description: 'Nuclear magneton',
examples: ['nuclearMagneton']
},
klitzing: {
description: 'Von Klitzing constant',
examples: ['klitzing']
},
bohrRadius: {
description: 'Bohr radius',
examples: ['bohrRadius']
},
classicalElectronRadius: {
description: 'Classical electron radius',
examples: ['classicalElectronRadius']
},
electronMass: {
description: 'Electron mass',
examples: ['electronMass']
},
fermiCoupling: {
description: 'Fermi coupling constant',
examples: ['fermiCoupling']
},
fineStructure: {
description: 'Fine-structure constant',
examples: ['fineStructure']
},
hartreeEnergy: {
description: 'Hartree energy',
examples: ['hartreeEnergy']
},
protonMass: {
description: 'Proton mass',
examples: ['protonMass']
},
deuteronMass: {
description: 'Deuteron Mass',
examples: ['deuteronMass']
},
neutronMass: {
description: 'Neutron mass',
examples: ['neutronMass']
},
quantumOfCirculation: {
description: 'Quantum of circulation',
examples: ['quantumOfCirculation']
},
rydberg: {
description: 'Rydberg constant',
examples: ['rydberg']
},
thomsonCrossSection: {
description: 'Thomson cross section',
examples: ['thomsonCrossSection']
},
weakMixingAngle: {
description: 'Weak mixing angle',
examples: ['weakMixingAngle']
},
efimovFactor: {
description: 'Efimov factor',
examples: ['efimovFactor']
},
atomicMass: {
description: 'Atomic mass constant',
examples: ['atomicMass']
},
avogadro: {
description: 'Avogadro\'s number',
examples: ['avogadro']
},
boltzmann: {
description: 'Boltzmann constant',
examples: ['boltzmann']
},
faraday: {
description: 'Faraday constant',
examples: ['faraday']
},
firstRadiation: {
description: 'First radiation constant',
examples: ['firstRadiation']
},
loschmidt: {
description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',
examples: ['loschmidt']
},
gasConstant: {
description: 'Gas constant',
examples: ['gasConstant']
},
molarPlanckConstant: {
description: 'Molar Planck constant',
examples: ['molarPlanckConstant']
},
molarVolume: {
description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',
examples: ['molarVolume']
},
sackurTetrode: {
description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',
examples: ['sackurTetrode']
},
secondRadiation: {
description: 'Second radiation constant',
examples: ['secondRadiation']
},
stefanBoltzmann: {
description: 'Stefan-Boltzmann constant',
examples: ['stefanBoltzmann']
},
wienDisplacement: {
description: 'Wien displacement law constant',
examples: ['wienDisplacement']
},
// spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},
molarMass: {
description: 'Molar mass constant',
examples: ['molarMass']
},
molarMassC12: {
description: 'Molar mass constant of carbon-12',
examples: ['molarMassC12']
},
gravity: {
description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',
examples: ['gravity']
},
planckLength: {
description: 'Planck length',
examples: ['planckLength']
},
planckMass: {
description: 'Planck mass',
examples: ['planckMass']
},
planckTime: {
description: 'Planck time',
examples: ['planckTime']
},
planckCharge: {
description: 'Planck charge',
examples: ['planckCharge']
},
planckTemperature: {
description: 'Planck temperature',
examples: ['planckTemperature']
},
// functions - algebra
derivative: _derivative.derivativeDocs,
lsolve: _lsolve.lsolveDocs,
lsolveAll: _lsolveAll.lsolveAllDocs,
lup: _lup.lupDocs,
lusolve: _lusolve.lusolveDocs,
leafCount: _leafCount.leafCountDocs,
polynomialRoot: _polynomialRoot.polynomialRootDocs,
resolve: _resolve.resolveDocs,
simplify: _simplify.simplifyDocs,
simplifyConstant: _simplifyConstant.simplifyConstantDocs,
simplifyCore: _simplifyCore.simplifyCoreDocs,
symbolicEqual: _symbolicEqual.symbolicEqualDocs,
rationalize: _rationalize.rationalizeDocs,
slu: _slu.sluDocs,
usolve: _usolve.usolveDocs,
usolveAll: _usolveAll.usolveAllDocs,
qr: _qr.qrDocs,
// functions - arithmetic
abs: _abs.absDocs,
add: _add.addDocs,
cbrt: _cbrt.cbrtDocs,
ceil: _ceil.ceilDocs,
cube: _cube.cubeDocs,
divide: _divide.divideDocs,
dotDivide: _dotDivide.dotDivideDocs,
dotMultiply: _dotMultiply.dotMultiplyDocs,
dotPow: _dotPow.dotPowDocs,
exp: _exp.expDocs,
expm: _expm.expmDocs,
expm1: _expm2.expm1Docs,
fix: _fix.fixDocs,
floor: _floor.floorDocs,
gcd: _gcd.gcdDocs,
hypot: _hypot.hypotDocs,
lcm: _lcm.lcmDocs,
log: _log.logDocs,
log2: _log3.log2Docs,
log1p: _log1p.log1pDocs,
log10: _log2.log10Docs,
mod: _mod.modDocs,
multiply: _multiply.multiplyDocs,
norm: _norm.normDocs,
nthRoot: _nthRoot.nthRootDocs,
nthRoots: _nthRoots.nthRootsDocs,
pow: _pow.powDocs,
round: _round.roundDocs,
sign: _sign.signDocs,
sqrt: _sqrt.sqrtDocs,
sqrtm: _sqrtm.sqrtmDocs,
square: _square.squareDocs,
subtract: _subtract.subtractDocs,
unaryMinus: _unaryMinus.unaryMinusDocs,
unaryPlus: _unaryPlus.unaryPlusDocs,
xgcd: _xgcd.xgcdDocs,
invmod: _invmod.invmodDocs,
// functions - bitwise
bitAnd: _bitAnd.bitAndDocs,
bitNot: _bitNot.bitNotDocs,
bitOr: _bitOr.bitOrDocs,
bitXor: _bitXor.bitXorDocs,
leftShift: _leftShift.leftShiftDocs,
rightArithShift: _rightArithShift.rightArithShiftDocs,
rightLogShift: _rightLogShift.rightLogShiftDocs,
// functions - combinatorics
bellNumbers: _bellNumbers.bellNumbersDocs,
catalan: _catalan.catalanDocs,
composition: _composition.compositionDocs,
stirlingS2: _stirlingS.stirlingS2Docs,
// functions - core
config: _config.configDocs,
import: _import.importDocs,
typed: _typed.typedDocs,
// functions - complex
arg: _arg.argDocs,
conj: _conj.conjDocs,
re: _re.reDocs,
im: _im.imDocs,
// functions - expression
evaluate: _evaluate.evaluateDocs,
help: _help.helpDocs,
// functions - geometry
distance: _distance.distanceDocs,
intersect: _intersect.intersectDocs,
// functions - logical
and: _and.andDocs,
not: _not.notDocs,
or: _or.orDocs,
xor: _xor.xorDocs,
// functions - matrix
concat: _concat.concatDocs,
count: _count.countDocs,
cross: _cross.crossDocs,
column: _column.columnDocs,
ctranspose: _ctranspose.ctransposeDocs,
det: _det.detDocs,
diag: _diag.diagDocs,
diff: _diff.diffDocs,
dot: _dot.dotDocs,
getMatrixDataType: _getMatrixDataType.getMatrixDataTypeDocs,
identity: _identity.identityDocs,
filter: _filter.filterDocs,
flatten: _flatten.flattenDocs,
forEach: _forEach.forEachDocs,
inv: _inv.invDocs,
pinv: _pinv.pinvDocs,
eigs: _eigs.eigsDocs,
kron: _kron.kronDocs,
matrixFromFunction: _matrixFromFunction.matrixFromFunctionDocs,
matrixFromRows: _matrixFromRows.matrixFromRowsDocs,
matrixFromColumns: _matrixFromColumns.matrixFromColumnsDocs,
map: _map.mapDocs,
ones: _ones.onesDocs,
partitionSelect: _partitionSelect.partitionSelectDocs,
range: _range.rangeDocs,
resize: _resize.resizeDocs,
reshape: _reshape.reshapeDocs,
rotate: _rotate.rotateDocs,
rotationMatrix: _rotationMatrix.rotationMatrixDocs,
row: _row.rowDocs,
size: _size.sizeDocs,
sort: _sort.sortDocs,
squeeze: _squeeze.squeezeDocs,
subset: _subset.subsetDocs,
trace: _trace.traceDocs,
transpose: _transpose.transposeDocs,
zeros: _zeros.zerosDocs,
fft: _fft.fftDocs,
ifft: _ifft.ifftDocs,
sylvester: _sylvester.sylvesterDocs,
schur: _schur.schurDocs,
lyap: _lyap.lyapDocs,
// functions - numeric
solveODE: _solveODE.solveODEDocs,
// functions - probability
combinations: _combinations.combinationsDocs,
combinationsWithRep: _combinationsWithRep.combinationsWithRepDocs,
// distribution: distributionDocs,
factorial: _factorial.factorialDocs,
gamma: _gamma.gammaDocs,
kldivergence: _kldivergence.kldivergenceDocs,
lgamma: _lgamma.lgammaDocs,
multinomial: _multinomial.multinomialDocs,
permutations: _permutations.permutationsDocs,
pickRandom: _pickRandom.pickRandomDocs,
random: _random.randomDocs,
randomInt: _randomInt.randomIntDocs,
// functions - relational
compare: _compare.compareDocs,
compareNatural: _compareNatural.compareNaturalDocs,
compareText: _compareText.compareTextDocs,
deepEqual: _deepEqual.deepEqualDocs,
equal: _equal.equalDocs,
equalText: _equalText.equalTextDocs,
larger: _larger.largerDocs,
largerEq: _largerEq.largerEqDocs,
smaller: _smaller.smallerDocs,
smallerEq: _smallerEq.smallerEqDocs,
unequal: _unequal.unequalDocs,
// functions - set
setCartesian: _setCartesian.setCartesianDocs,
setDifference: _setDifference.setDifferenceDocs,
setDistinct: _setDistinct.setDistinctDocs,
setIntersect: _setIntersect.setIntersectDocs,
setIsSubset: _setIsSubset.setIsSubsetDocs,
setMultiplicity: _setMultiplicity.setMultiplicityDocs,
setPowerset: _setPowerset.setPowersetDocs,
setSize: _setSize.setSizeDocs,
setSymDifference: _setSymDifference.setSymDifferenceDocs,
setUnion: _setUnion.setUnionDocs,
// functions - signal
zpk2tf: _zpk2tf.zpk2tfDocs,
freqz: _freqz.freqzDocs,
// functions - special
erf: _erf.erfDocs,
zeta: _zeta.zetaDocs,
// functions - statistics
cumsum: _cumsum.cumSumDocs,
mad: _mad.madDocs,
max: _max.maxDocs,
mean: _mean.meanDocs,
median: _median.medianDocs,
min: _min.minDocs,
mode: _mode.modeDocs,
prod: _prod.prodDocs,
quantileSeq: _quantileSeq.quantileSeqDocs,
std: _std.stdDocs,
sum: _sum.sumDocs,
variance: _variance.varianceDocs,
corr: _corr.corrDocs,
// functions - trigonometry
acos: _acos.acosDocs,
acosh: _acosh.acoshDocs,
acot: _acot.acotDocs,
acoth: _acoth.acothDocs,
acsc: _acsc.acscDocs,
acsch: _acsch.acschDocs,
asec: _asec.asecDocs,
asech: _asech.asechDocs,
asin: _asin.asinDocs,
asinh: _asinh.asinhDocs,
atan: _atan.atanDocs,
atanh: _atanh.atanhDocs,
atan2: _atan2.atan2Docs,
cos: _cos.cosDocs,
cosh: _cosh.coshDocs,
cot: _cot.cotDocs,
coth: _coth.cothDocs,
csc: _csc.cscDocs,
csch: _csch.cschDocs,
sec: _sec.secDocs,
sech: _sech.sechDocs,
sin: _sin.sinDocs,
sinh: _sinh.sinhDocs,
tan: _tan.tanDocs,
tanh: _tanh.tanhDocs,
// functions - units
to: _to.toDocs,
// functions - utils
clone: _clone.cloneDocs,
format: _format.formatDocs,
bin: _bin.binDocs,
oct: _oct.octDocs,
hex: _hex.hexDocs,
isNaN: _isNaN.isNaNDocs,
isInteger: _isInteger.isIntegerDocs,
isNegative: _isNegative.isNegativeDocs,
isNumeric: _isNumeric.isNumericDocs,
hasNumericValue: _hasNumericValue.hasNumericValueDocs,
isPositive: _isPositive.isPositiveDocs,
isPrime: _isPrime.isPrimeDocs,
isZero: _isZero.isZeroDocs,
print: _print.printDocs,
typeOf: _typeOf.typeOfDocs,
numeric: _numeric.numericDocs
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.derivativeDocs = void 0;
const derivativeDocs = exports.derivativeDocs = {
name: 'derivative',
category: 'Algebra',
syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],
description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',
examples: ['derivative("2x^3", "x")', 'derivative("2x^3", "x", {simplify: false})', 'derivative("2x^2 + 3x + 4", "x")', 'derivative("sin(2x)", "x")', 'f = parse("x^2 + x")', 'x = parse("x")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'],
seealso: ['simplify', 'parse', 'evaluate']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.leafCountDocs = void 0;
const leafCountDocs = exports.leafCountDocs = {
name: 'leafCount',
category: 'Algebra',
syntax: ['leafCount(expr)'],
description: 'Computes the number of leaves in the parse tree of the given expression',
examples: ['leafCount("e^(i*pi)-1")', 'leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],
seealso: ['simplify']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lsolveDocs = void 0;
const lsolveDocs = exports.lsolveDocs = {
name: 'lsolve',
category: 'Algebra',
syntax: ['x=lsolve(L, b)'],
description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',
examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],
seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lsolveAllDocs = void 0;
const lsolveAllDocs = exports.lsolveAllDocs = {
name: 'lsolveAll',
category: 'Algebra',
syntax: ['x=lsolveAll(L, b)'],
description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',
examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],
seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lupDocs = void 0;
const lupDocs = exports.lupDocs = {
name: 'lup',
category: 'Algebra',
syntax: ['lup(m)'],
description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',
examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],
seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lusolveDocs = void 0;
const lusolveDocs = exports.lusolveDocs = {
name: 'lusolve',
category: 'Algebra',
syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],
description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',
examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],
seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lyapDocs = void 0;
const lyapDocs = exports.lyapDocs = {
name: 'lyap',
category: 'Algebra',
syntax: ['lyap(A,Q)'],
description: 'Solves the Continuous-time Lyapunov equation AP+PA\'+Q=0 for P',
examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],
seealso: ['schur', 'sylvester']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.polynomialRootDocs = void 0;
const polynomialRootDocs = exports.polynomialRootDocs = {
name: 'polynomialRoot',
category: 'Algebra',
syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],
description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',
examples: ['a = polynomialRoot(-6, 11, -6, 1)'],
seealso: ['cbrt', 'sqrt']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.qrDocs = void 0;
const qrDocs = exports.qrDocs = {
name: 'qr',
category: 'Algebra',
syntax: ['qr(A)'],
description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',
examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],
seealso: ['lup', 'slu', 'matrix']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.rationalizeDocs = void 0;
const rationalizeDocs = exports.rationalizeDocs = {
name: 'rationalize',
category: 'Algebra',
syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],
description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',
examples: ['rationalize("2x/y - y/(x+1)")', 'rationalize("2x/y - y/(x+1)", true)'],
seealso: ['simplify']
};

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolveDocs = void 0;
const resolveDocs = exports.resolveDocs = {
name: 'resolve',
category: 'Algebra',
syntax: ['resolve(node, scope)'],
description: 'Recursively substitute variables in an expression tree.',
examples: ['resolve(parse("1 + x"), { x: 7 })', 'resolve(parse("size(text)"), { text: "Hello World" })', 'resolve(parse("x + y"), { x: parse("3z") })', 'resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],
seealso: ['simplify', 'evaluate'],
mayThrow: ['ReferenceError']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.schurDocs = void 0;
const schurDocs = exports.schurDocs = {
name: 'schur',
category: 'Algebra',
syntax: ['schur(A)'],
description: 'Performs a real Schur decomposition of the real matrix A = UTU\'',
examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],
seealso: ['lyap', 'sylvester']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.simplifyDocs = void 0;
const simplifyDocs = exports.simplifyDocs = {
name: 'simplify',
category: 'Algebra',
syntax: ['simplify(expr)', 'simplify(expr, rules)'],
description: 'Simplify an expression tree.',
examples: ['simplify("3 + 2 / 4")', 'simplify("2x + x")', 'f = parse("x * (x + 2 + x)")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],
seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.simplifyConstantDocs = void 0;
const simplifyConstantDocs = exports.simplifyConstantDocs = {
name: 'simplifyConstant',
category: 'Algebra',
syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],
description: 'Replace constant subexpressions of node with their values.',
examples: ['simplifyConstant("(3-3)*x")', 'simplifyConstant(parse("z-cos(tau/8)"))'],
seealso: ['simplify', 'simplifyCore', 'evaluate']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.simplifyCoreDocs = void 0;
const simplifyCoreDocs = exports.simplifyCoreDocs = {
name: 'simplifyCore',
category: 'Algebra',
syntax: ['simplifyCore(node)'],
description: 'Perform simple one-pass simplifications on an expression tree.',
examples: ['simplifyCore(parse("0*x"))', 'simplifyCore(parse("(x+0)*2"))'],
seealso: ['simplify', 'simplifyConstant', 'evaluate']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sluDocs = void 0;
const sluDocs = exports.sluDocs = {
name: 'slu',
category: 'Algebra',
syntax: ['slu(A, order, threshold)'],
description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',
examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'],
seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sylvesterDocs = void 0;
const sylvesterDocs = exports.sylvesterDocs = {
name: 'sylvester',
category: 'Algebra',
syntax: ['sylvester(A,B,C)'],
description: 'Solves the real-valued Sylvester equation AX+XB=C for X',
examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'],
seealso: ['schur', 'lyap']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.symbolicEqualDocs = void 0;
const symbolicEqualDocs = exports.symbolicEqualDocs = {
name: 'symbolicEqual',
category: 'Algebra',
syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],
description: 'Returns true if the difference of the expressions simplifies to 0',
examples: ['symbolicEqual("x*y","y*x")', 'symbolicEqual("abs(x^2)", "x^2")', 'symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],
seealso: ['simplify', 'evaluate']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.usolveDocs = void 0;
const usolveDocs = exports.usolveDocs = {
name: 'usolve',
category: 'Algebra',
syntax: ['x=usolve(U, b)'],
description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',
examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],
seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.usolveAllDocs = void 0;
const usolveAllDocs = exports.usolveAllDocs = {
name: 'usolveAll',
category: 'Algebra',
syntax: ['x=usolve(U, b)'],
description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',
examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],
seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.absDocs = void 0;
const absDocs = exports.absDocs = {
name: 'abs',
category: 'Arithmetic',
syntax: ['abs(x)'],
description: 'Compute the absolute value.',
examples: ['abs(3.5)', 'abs(-4.2)'],
seealso: ['sign']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addDocs = void 0;
const addDocs = exports.addDocs = {
name: 'add',
category: 'Operators',
syntax: ['x + y', 'add(x, y)'],
description: 'Add two values.',
examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '"2.3" + "4"'],
seealso: ['subtract']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cbrtDocs = void 0;
const cbrtDocs = exports.cbrtDocs = {
name: 'cbrt',
category: 'Arithmetic',
syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],
description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',
examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],
seealso: ['square', 'sqrt', 'cube', 'multiply']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ceilDocs = void 0;
const ceilDocs = exports.ceilDocs = {
name: 'ceil',
category: 'Arithmetic',
syntax: ['ceil(x)'],
description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',
examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)'],
seealso: ['floor', 'fix', 'round']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cubeDocs = void 0;
const cubeDocs = exports.cubeDocs = {
name: 'cube',
category: 'Arithmetic',
syntax: ['cube(x)'],
description: 'Compute the cube of a value. The cube of x is x * x * x.',
examples: ['cube(2)', '2^3', '2 * 2 * 2'],
seealso: ['multiply', 'square', 'pow']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.divideDocs = void 0;
const divideDocs = exports.divideDocs = {
name: 'divide',
category: 'Operators',
syntax: ['x / y', 'divide(x, y)'],
description: 'Divide two values.',
examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],
seealso: ['multiply']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.dotDivideDocs = void 0;
const dotDivideDocs = exports.dotDivideDocs = {
name: 'dotDivide',
category: 'Operators',
syntax: ['x ./ y', 'dotDivide(x, y)'],
description: 'Divide two values element wise.',
examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],
seealso: ['multiply', 'dotMultiply', 'divide']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.dotMultiplyDocs = void 0;
const dotMultiplyDocs = exports.dotMultiplyDocs = {
name: 'dotMultiply',
category: 'Operators',
syntax: ['x .* y', 'dotMultiply(x, y)'],
description: 'Multiply two values element wise.',
examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],
seealso: ['multiply', 'divide', 'dotDivide']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.dotPowDocs = void 0;
const dotPowDocs = exports.dotPowDocs = {
name: 'dotPow',
category: 'Operators',
syntax: ['x .^ y', 'dotPow(x, y)'],
description: 'Calculates the power of x to y element wise.',
examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],
seealso: ['pow']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.expDocs = void 0;
const expDocs = exports.expDocs = {
name: 'exp',
category: 'Arithmetic',
syntax: ['exp(x)'],
description: 'Calculate the exponent of a value.',
examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\'s formula'],
seealso: ['expm', 'expm1', 'pow', 'log']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.expmDocs = void 0;
const expmDocs = exports.expmDocs = {
name: 'expm',
category: 'Arithmetic',
syntax: ['exp(x)'],
description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.',
examples: ['expm([[0,2],[0,0]])'],
seealso: ['exp']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.expm1Docs = void 0;
const expm1Docs = exports.expm1Docs = {
name: 'expm1',
category: 'Arithmetic',
syntax: ['expm1(x)'],
description: 'Calculate the value of subtracting 1 from the exponential value.',
examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],
seealso: ['exp', 'pow', 'log']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fixDocs = void 0;
const fixDocs = exports.fixDocs = {
name: 'fix',
category: 'Arithmetic',
syntax: ['fix(x)'],
description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',
examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)'],
seealso: ['ceil', 'floor', 'round']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.floorDocs = void 0;
const floorDocs = exports.floorDocs = {
name: 'floor',
category: 'Arithmetic',
syntax: ['floor(x)'],
description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',
examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)'],
seealso: ['ceil', 'fix', 'round']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.gcdDocs = void 0;
const gcdDocs = exports.gcdDocs = {
name: 'gcd',
category: 'Arithmetic',
syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],
description: 'Compute the greatest common divisor.',
examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],
seealso: ['lcm', 'xgcd']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hypotDocs = void 0;
const hypotDocs = exports.hypotDocs = {
name: 'hypot',
category: 'Arithmetic',
syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],
description: 'Calculate the hypotenuse of a list with values.',
examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],
seealso: ['abs', 'norm']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.invmodDocs = void 0;
const invmodDocs = exports.invmodDocs = {
name: 'invmod',
category: 'Arithmetic',
syntax: ['invmod(a, b)'],
description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)',
examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],
seealso: ['gcd', 'xgcd']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.lcmDocs = void 0;
const lcmDocs = exports.lcmDocs = {
name: 'lcm',
category: 'Arithmetic',
syntax: ['lcm(x, y)'],
description: 'Compute the least common multiple.',
examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],
seealso: ['gcd']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.logDocs = void 0;
const logDocs = exports.logDocs = {
name: 'log',
category: 'Arithmetic',
syntax: ['log(x)', 'log(x, base)'],
description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',
examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'],
seealso: ['exp', 'log1p', 'log2', 'log10']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.log10Docs = void 0;
const log10Docs = exports.log10Docs = {
name: 'log10',
category: 'Arithmetic',
syntax: ['log10(x)'],
description: 'Compute the 10-base logarithm of a value.',
examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],
seealso: ['exp', 'log']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.log1pDocs = void 0;
const log1pDocs = exports.log1pDocs = {
name: 'log1p',
category: 'Arithmetic',
syntax: ['log1p(x)', 'log1p(x, base)'],
description: 'Calculate the logarithm of a `value+1`',
examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],
seealso: ['exp', 'log', 'log2', 'log10']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.log2Docs = void 0;
const log2Docs = exports.log2Docs = {
name: 'log2',
category: 'Arithmetic',
syntax: ['log2(x)'],
description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',
examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],
seealso: ['exp', 'log1p', 'log', 'log10']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.modDocs = void 0;
const modDocs = exports.modDocs = {
name: 'mod',
category: 'Operators',
syntax: ['x % y', 'x mod y', 'mod(x, y)'],
description: 'Calculates the modulus, the remainder of an integer division.',
examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],
seealso: ['divide']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.multiplyDocs = void 0;
const multiplyDocs = exports.multiplyDocs = {
name: 'multiply',
category: 'Operators',
syntax: ['x * y', 'multiply(x, y)'],
description: 'multiply two values.',
examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],
seealso: ['divide']
};

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normDocs = void 0;
const normDocs = exports.normDocs = {
name: 'norm',
category: 'Arithmetic',
syntax: ['norm(x)', 'norm(x, p)'],
description: 'Calculate the norm of a number, vector or matrix.',
examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], "inf")', 'norm([[1, 2], [3, 4]], "fro")']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.nthRootDocs = void 0;
const nthRootDocs = exports.nthRootDocs = {
name: 'nthRoot',
category: 'Arithmetic',
syntax: ['nthRoot(a)', 'nthRoot(a, root)'],
description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation "x^root = A".',
examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],
seealso: ['nthRoots', 'pow', 'sqrt']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.nthRootsDocs = void 0;
const nthRootsDocs = exports.nthRootsDocs = {
name: 'nthRoots',
category: 'Arithmetic',
syntax: ['nthRoots(A)', 'nthRoots(A, root)'],
description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation "x^root = A". ' + 'This function returns an array of complex values.',
examples: ['nthRoots(1)', 'nthRoots(1, 3)'],
seealso: ['sqrt', 'pow', 'nthRoot']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.powDocs = void 0;
const powDocs = exports.powDocs = {
name: 'pow',
category: 'Operators',
syntax: ['x ^ y', 'pow(x, y)'],
description: 'Calculates the power of x to y, x^y.',
examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],
seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.roundDocs = void 0;
const roundDocs = exports.roundDocs = {
name: 'round',
category: 'Arithmetic',
syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],
description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',
examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'],
seealso: ['ceil', 'floor', 'fix']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.signDocs = void 0;
const signDocs = exports.signDocs = {
name: 'sign',
category: 'Arithmetic',
syntax: ['sign(x)'],
description: 'Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.',
examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],
seealso: ['abs']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sqrtDocs = void 0;
const sqrtDocs = exports.sqrtDocs = {
name: 'sqrt',
category: 'Arithmetic',
syntax: ['sqrt(x)'],
description: 'Compute the square root value. If x = y * y, then y is the square root of x.',
examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],
seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sqrtmDocs = void 0;
const sqrtmDocs = exports.sqrtmDocs = {
name: 'sqrtm',
category: 'Arithmetic',
syntax: ['sqrtm(x)'],
description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',
examples: ['sqrtm([[33, 24], [48, 57]])'],
seealso: ['sqrt', 'abs', 'square', 'multiply']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.squareDocs = void 0;
const squareDocs = exports.squareDocs = {
name: 'square',
category: 'Arithmetic',
syntax: ['square(x)'],
description: 'Compute the square of a value. The square of x is x * x.',
examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],
seealso: ['multiply', 'pow', 'sqrt', 'cube']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.subtractDocs = void 0;
const subtractDocs = exports.subtractDocs = {
name: 'subtract',
category: 'Operators',
syntax: ['x - y', 'subtract(x, y)'],
description: 'subtract two values.',
examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],
seealso: ['add']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unaryMinusDocs = void 0;
const unaryMinusDocs = exports.unaryMinusDocs = {
name: 'unaryMinus',
category: 'Operators',
syntax: ['-x', 'unaryMinus(x)'],
description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',
examples: ['-4.5', '-(-5.6)', '-"22"'],
seealso: ['add', 'subtract', 'unaryPlus']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.unaryPlusDocs = void 0;
const unaryPlusDocs = exports.unaryPlusDocs = {
name: 'unaryPlus',
category: 'Operators',
syntax: ['+x', 'unaryPlus(x)'],
description: 'Converts booleans and strings to numbers.',
examples: ['+true', '+"2"'],
seealso: ['add', 'subtract', 'unaryMinus']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.xgcdDocs = void 0;
const xgcdDocs = exports.xgcdDocs = {
name: 'xgcd',
category: 'Arithmetic',
syntax: ['xgcd(a, b)'],
description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',
examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],
seealso: ['gcd', 'lcm']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bitAndDocs = void 0;
const bitAndDocs = exports.bitAndDocs = {
name: 'bitAnd',
category: 'Bitwise',
syntax: ['x & y', 'bitAnd(x, y)'],
description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',
examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],
seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bitNotDocs = void 0;
const bitNotDocs = exports.bitNotDocs = {
name: 'bitNot',
category: 'Bitwise',
syntax: ['~x', 'bitNot(x)'],
description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',
examples: ['~1', '~2', 'bitNot([2, -3, 4])'],
seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bitOrDocs = void 0;
const bitOrDocs = exports.bitOrDocs = {
name: 'bitOr',
category: 'Bitwise',
syntax: ['x | y', 'bitOr(x, y)'],
description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',
examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],
seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bitXorDocs = void 0;
const bitXorDocs = exports.bitXorDocs = {
name: 'bitXor',
category: 'Bitwise',
syntax: ['bitXor(x, y)'],
description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',
examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],
seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.leftShiftDocs = void 0;
const leftShiftDocs = exports.leftShiftDocs = {
name: 'leftShift',
category: 'Bitwise',
syntax: ['x << y', 'leftShift(x, y)'],
description: 'Bitwise left logical shift of a value x by y number of bits.',
examples: ['4 << 1', '8 >> 1'],
seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.rightArithShiftDocs = void 0;
const rightArithShiftDocs = exports.rightArithShiftDocs = {
name: 'rightArithShift',
category: 'Bitwise',
syntax: ['x >> y', 'rightArithShift(x, y)'],
description: 'Bitwise right arithmetic shift of a value x by y number of bits.',
examples: ['8 >> 1', '4 << 1', '-12 >> 2'],
seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']
};

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.rightLogShiftDocs = void 0;
const rightLogShiftDocs = exports.rightLogShiftDocs = {
name: 'rightLogShift',
category: 'Bitwise',
syntax: ['x >>> y', 'rightLogShift(x, y)'],
description: 'Bitwise right logical shift of a value x by y number of bits.',
examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],
seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']
};

Some files were not shown because too many files have changed in this diff Show More