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

View File

@@ -0,0 +1,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,7 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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,8 @@
export var 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']
};