Full Logic Syntax List

Below is the full list of syntax accepted by CheckFirst, as per math.js

Custom functions

Function

Description

ifelse(conditions,then,else...)

Executes an action if a condition is met (true) and another action if that condition is not met (false).

countif([Range],condition)

Count the number of elements that fulfil a condition.

Math.js functions

CheckFirst's logic calculations is powered by math.js. Logic blocks accept all functions listed.

Expression functions

Function

Description

Parse and compile an expression.

Evaluate an expression.

Retrieve help on a function or data type.

Create a parser.

Algebra functions

Function

Description

Takes the derivative of an expression expressed in parser Nodes.

Finds one solution of a linear equation system by forwards substitution.

Finds all solutions of a linear equation system by forwards substitution.

Calculate the Matrix LU decomposition with partial pivoting.

Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.

Calculate the Matrix QR decomposition.

Transform a rationalizable expression in a rational fraction.

Simplify an expression tree.

Calculate the Sparse Matrix LU decomposition with full pivoting.

Finds one solution of a linear equation system by backward substitution.

Finds all solutions of a linear equation system by backward substitution.

Arithmetic functions

Function

Description

Calculate the absolute value of a number.

Add two or more values, x + y.

Calculate the cubic root of a value.

Round a value towards plus infinity If x is complex, both real and imaginary part are rounded towards plus infinity.

Compute the cube of a value, x x x.

Divide two values, x / y.

Divide two matrices element wise.

Multiply two matrices element wise.

Calculates the power of x to y element wise.

Calculate the exponent of a value.

Calculate the value of subtracting 1 from the exponential value.

Round a value towards zero.

Round a value towards minus infinity.

Calculate the greatest common divisor for two or more values or arrays.

Calculate the hypotenusa of a list with values.

Calculate the least common multiple for two or more values or arrays.

Calculate the logarithm of a value.

Calculate the 10-base logarithm of a value.

Calculate the logarithm of a value+1.

Calculate the 2-base of a value.

Calculates the modulus, the remainder of an integer division.

Multiply two or more values, x * y.

Calculate the norm of a number, vector or matrix.

Calculate the nth root of a value.

Calculate the nth roots of a value.

Calculates the power of x to y, x ^ y.

Round a value towards the nearest integer.

Compute the sign of a value.

Calculate the square root of a value.

Compute the square of a value, x * x.

Subtract two values, x - y.

Inverse the sign of a value, apply a unary minus operation.

Unary plus operation.

Calculate the extended greatest common divisor for two values.

Bitwise functions

Function

Description

Bitwise AND two values, x & y.

Bitwise NOT value, ~x.

Bitwise OR two values, x | y.

Bitwise XOR two values, x ^ y.

Bitwise left logical shift of a value x by y number of bits, x << y.

Bitwise right arithmetic shift of a value x by y number of bits, x >> y.

Bitwise right logical shift of value x by y number of bits, x >>> y.

Combinatorics functions

Function

Description

The Bell Numbers count the number of partitions of a set.

The Catalan Numbers enumerate combinatorial structures of many different types.

The composition counts of n into k parts.

The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets.

Complex functions

Function

Description

Compute the argument of a complex value.

Compute the complex conjugate of a complex value.

Get the imaginary part of a complex number.

Get the real part of a complex number.

Geometry functions

Function

Description

Calculates: The eucledian distance between two points in N-dimensional spaces.

Calculates the point of intersection of two lines in two or three dimensions and of a line and a plane in three dimensions.

Logical functions

Function

Description

Logical and.

Logical not.

Logical or.

Logical xor.

Matrix functions

Function

Description

Apply a function that maps an array to a scalar along a given axis of a matrix or array.

Return a column from a Matrix.

Concatenate two or more matrices.

Count the number of elements of a matrix, array or string.

Calculate the cross product for two vectors in three dimensional space.

Transpose and complex conjugate a matrix.

Calculate the determinant of a matrix.

Create a diagonal matrix or retrieve the diagonal of a matrix When x is a vector, a matrix with vector x on the diagonal will be returned.

Create a new matrix or array of the difference between elements of the given array The optional dim parameter lets you specify the dimension to evaluate the difference of If no dimension parameter is passed it is assumed as dimension 0 Dimension is zero-based in javascript and one-based in the parser and can be a number or bignumber Arrays must be ‘rectangular’ meaning arrays like [1, 2] If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays.

Calculate the dot product of two vectors.

Compute eigenvalues and eigenvectors of a matrix.

Compute the matrix exponential, expm(A) = e^A.

Filter the items in an array or one dimensional matrix.

Flatten a multi dimensional matrix into a single dimensional matrix.

Iterate over all elements of a matrix/array, and executes the given callback function.

Find the data type of all elements in a matrix or array, for example ‘number’ if all items are a number and ‘Complex’ if all values are complex numbers.

Create a 2-dimensional identity matrix with size m x n or n x n.

Calculate the inverse of a square matrix.

Calculates the kronecker product of 2 matrices or vectors.

Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.

Create a dense matrix from vectors as individual columns.

Create a matrix by evaluating a generating function at each index.

Create a dense matrix from vectors as individual rows.

Create a matrix filled with ones.

Partition-based selection of an array or 1D matrix.

Create an array from a range.

Reshape a multi dimensional array to fit the specified dimensions.

Resize a matrix.

Rotate a vector of size 1x2 counter-clockwise by a given angle Rotate a vector of size 1x3 counter-clockwise by a given angle around the given axis.

Create a 2-dimensional counter-clockwise rotation matrix (2x2) for a given angle (expressed in radians).

Return a row from a Matrix.

Calculate the size of a matrix or scalar.

Sort the items in a matrix.

Calculate the principal square root of a square matrix.

Squeeze a matrix, remove inner and outer singleton dimensions from a matrix.

Get or set a subset of a matrix or string.

Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.

Transpose a matrix.

Create a matrix filled with zeros.

Probability functions

Function

Description

Compute the number of ways of picking k unordered outcomes from n possibilities.

Compute the number of ways of picking k unordered outcomes from n possibilities, allowing individual outcomes to be repeated more than once.

Compute the factorial of a value Factorial only supports an integer value as argument.

Compute the gamma function of a value using Lanczos approximation for small values, and an extended Stirling approximation for large values.

Calculate the Kullback-Leibler (KL) divergence between two distributions.

Multinomial Coefficients compute the number of ways of picking a1, a2, .

Compute the number of ways of obtaining an ordered subset of k elements from a set of n elements.

Random pick one or more values from a one dimensional array.

Return a random number larger or equal to min and smaller than max using a uniform distribution.

Return a random integer number larger or equal to min and smaller than max using a uniform distribution.

Relational functions

Function

Description

Compare two values.

Compare two values of any type in a deterministic, natural way.

Compare two strings lexically.

Test element wise whether two matrices are equal.

Test whether two values are equal.

Check equality of two strings.

Test whether value x is larger than y.

Test whether value x is larger or equal to y.

Test whether value x is smaller than y.

Test whether value x is smaller or equal to y.

Test whether two values are unequal.

Set functions

Function

Description

Create the cartesian product of two (multi)sets.

Create the difference of two (multi)sets: every element of set1, that is not the element of set2.

Collect the distinct elements of a multiset.

Create the intersection of two (multi)sets.

Check whether a (multi)set is a subset of another (multi)set.

Count the multiplicity of an element in a multiset.

Create the powerset of a (multi)set.

Count the number of elements of a (multi)set.

Create the symmetric difference of two (multi)sets.

Create the union of two (multi)sets.

Special functions

Function

Description

Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x.

Statistics functions

Function

Description

Compute the median absolute deviation of a matrix or a list with values.

Compute the maximum value of a matrix or a list with values.

Compute the mean value of matrix or a list with values.

Compute the median of a matrix or a list with values.

Compute the minimum value of a matrix or a list of values.

Computes the mode of a set of numbers or a list with values(numbers or characters).

Compute the product of a matrix or a list with values.

Compute the prob order quantile of a matrix or a list with values.

Compute the standard deviation of a matrix or a list with values.

Compute the sum of a matrix or a list with values.

Compute the variance of a matrix or a list with values.

String functions

Function

Description

Format a number as binary.

Format a value of any type into a string.

Format a number as hexadecimal.

Format a number as octal.

Interpolate values into a string template.

Trigonometry functions

Function

Description

Calculate the inverse cosine of a value.

Calculate the hyperbolic arccos of a value, defined as acosh(x) = ln(sqrt(x^2 - 1) + x).

Calculate the inverse cotangent of a value, defined as acot(x) = atan(1/x).

Calculate the hyperbolic arccotangent of a value, defined as acoth(x) = atanh(1/x) = (ln((x+1)/x) + ln(x/(x-1))) / 2.

Calculate the inverse cosecant of a value, defined as acsc(x) = asin(1/x).

Calculate the hyperbolic arccosecant of a value, defined as acsch(x) = asinh(1/x) = ln(1/x + sqrt(1/x^2 + 1)).

Calculate the inverse secant of a value.

Calculate the hyperbolic arcsecant of a value, defined as asech(x) = acosh(1/x) = ln(sqrt(1/x^2 - 1) + 1/x).

Calculate the inverse sine of a value.

Calculate the hyperbolic arcsine of a value, defined as asinh(x) = ln(x + sqrt(x^2 + 1)).

Calculate the inverse tangent of a value.

Calculate the inverse tangent function with two arguments, y/x.

Calculate the hyperbolic arctangent of a value, defined as atanh(x) = ln((1 + x)/(1 - x)) / 2.

Calculate the cosine of a value.

Calculate the hyperbolic cosine of a value, defined as cosh(x) = 1/2 * (exp(x) + exp(-x)).

Calculate the cotangent of a value.

Calculate the hyperbolic cotangent of a value, defined as coth(x) = 1 / tanh(x).

Calculate the cosecant of a value, defined as csc(x) = 1/sin(x).

Calculate the hyperbolic cosecant of a value, defined as csch(x) = 1 / sinh(x).

Calculate the secant of a value, defined as sec(x) = 1/cos(x).

Calculate the hyperbolic secant of a value, defined as sech(x) = 1 / cosh(x).

Calculate the sine of a value.

Calculate the hyperbolic sine of a value, defined as sinh(x) = 1/2 * (exp(x) - exp(-x)).

Calculate the tangent of a value.

Calculate the hyperbolic tangent of a value, defined as tanh(x) = (exp(2 x) - 1) / (exp(2 x) + 1).

Unit functions

Function

Description

Change the unit of a value.

Utils functions

Function

Description

Clone an object.

Test whether a value is an numeric value.

Test whether a value is an integer number.

Test whether a value is NaN (not a number).

Test whether a value is negative: smaller than zero.

Test whether a value is an numeric value.

Test whether a value is positive: larger than zero.

Test whether a value is prime: has no divisors other than itself and one.

Test whether a value is zero.

Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.

Determine the type of a variable.

Last updated