Std.Math

The Std.Math namespace contains the following functions and operations:

Name Description
AbsComplex Returns the absolute value of a complex number of type Complex.
AbsComplexPolar Returns the absolute value of a complex number of type ComplexPolar.
AbsD Returns the absolute value of a double-precision floating-point number.
AbsI Returns the absolute value of an integer.
AbsL Returns the absolute value of a large integer.
AbsSquaredComplex Returns the squared absolute value of a complex number of type Complex.
AbsSquaredComplexPolar Returns the squared absolute value of a complex number of type ComplexPolar.
ApproximateFactorial Returns an approximate factorial of a given number.
ArcCos Returns the angle whose cosine is the specified number.
ArcCosh Computes the inverse hyperbolic cosine of a number.
ArcSin Returns the angle whose sine is the specified number.
ArcSinh Computes the inverse hyperbolic sine of a number.
ArcTan Returns the angle whose tangent is the specified number.
ArcTan2 Returns the angle whose tangent is the quotient of two specified numbers.
ArcTanh Computes the inverse hyperbolic tangent of a number.
ArgComplex Returns the phase of a complex number of type Complex.
ArgComplexPolar Returns the phase of a complex number of type ComplexPolar.
Binom Returns the approximate binomial coefficient of two integers.
BitSizeI For a non-negative integer a, returns the number of bits required to represent a. NOTE: This function returns the smallest n such that a < 2^n.
BitSizeL For a non-negative integer a, returns the number of bits required to represent a. NOTE: This function returns the smallest n such that a < 2^n.
Ceiling Returns the smallest integer greater than or equal to the specified number. For example: Ceiling(3.1) = 4; Ceiling(-3.7) = -3
Complex Represents a complex number by its real and imaginary components. The first element of the tuple is the real component, the second one - the imaginary component.
ComplexPolar Represents a complex number in polar form. The polar representation of a complex number is c = rโ‹…๐‘’^(t๐‘–).
ContinuedFractionConvergentI Finds the continued fraction convergent closest to fraction with the denominator less or equal to denominatorBound Using process similar to this: https://nrich.maths.org/1397
ContinuedFractionConvergentL Finds the continued fraction convergent closest to fraction with the denominator less or equal to denominatorBound Using process similar to this: https://nrich.maths.org/1397
Cos Returns the cosine of the specified angle.
Cosh Returns the hyperbolic cosine of the specified angle.
DividedByC Returns the quotient of two inputs of type Complex.
DividedByCP Returns the quotient of two inputs of type ComplexPolar.
DivRemI Divides one Integer value by another, returns the result and the remainder as a tuple.
DivRemL Divides one BigInteger value by another, returns the result and the remainder as a tuple.
E Returns a double-precision approximation of the mathematical constant ๐’† โ‰ˆ 2.7182818284590452354
ExpModI Returns an integer raised to a given power, with respect to a given modulus. I.e. (expBase^power) % modulus.
ExpModL Returns an integer raised to a given power, with respect to a given modulus. I.e. (expBase^power) % modulus.
ExtendedGreatestCommonDivisorI Returns a tuple (u,v) such that ua+vb=GCD(a,b) Note: GCD is always positive except that GCD(0,0)=0.
ExtendedGreatestCommonDivisorL Returns a tuple (u,v) such that ua+vb=GCD(a,b) Note: GCD is always positive except that GCD(0,0)=0.
FactorialI Returns the factorial of a given number.
FactorialL Returns the factorial of a given number.
Floor Returns the largest integer less than or equal to the specified number. For example: Floor(3.7) = 3; Floor(-3.1) = -4
GreatestCommonDivisorI Computes the greatest common divisor of two integers. Note: GCD is always positive except that GCD(0,0)=0.
GreatestCommonDivisorL Computes the greatest common divisor of two integers. Note: GCD is always positive except that GCD(0,0)=0.
HammingWeightI Returns the number of 1 bits in the binary representation of integer n.
InverseModI Returns the multiplicative inverse of a modular integer.
InverseModL Returns the multiplicative inverse of a modular integer.
IsCoprimeI Returns if two integers are co-prime.
IsCoprimeL Returns if two integers are co-prime.
IsInfinite Returns whether a given floating-point value is either positive or negative infinity.
IsNaN Returns whether a given floating-point value is not a number (i.e. is NaN).
LargestFixedPoint Returns the largest representable number for specific fixed point dimensions.
Lg Computes the base-2 logarithm of a number.
Log Returns the natural (base e) logarithm of a specified number.
Log10 Returns the base-10 logarithm of a specified number.
LogFactorialD Returns the approximate natural logarithm of the factorial of a given integer.
LogGammaD Returns the natural logarithm of the gamma function (aka the log-gamma function).
LogOf2 Returns a double-precision approximation of the constant ใ‘2 โ‰ˆ 0.6931471805599453
Max Given an array of integers, returns the largest element.
MaxD Returns the larger of two specified numbers.
MaxI Returns the larger of two specified numbers.
MaxL Returns the larger of two specified numbers.
Min Given an array of integers, returns the smallest element.
MinD Returns the smaller of two specified numbers.
MinI Returns the smaller of two specified numbers.
MinL Returns the smaller of two specified numbers.
MinusC Returns the difference between two inputs of type Complex.
MinusCP Returns the difference between two inputs of type ComplexPolar.
ModulusI Computes the canonical residue of value modulo modulus. The result is always in the range 0..modulus-1 even for negative numbers.
ModulusL Computes the canonical residue of value modulo modulus. The result is always in the range 0..modulus-1 even for negative numbers.
NegationC Returns the unary negation of an input of type Complex.
NegationCP Returns the unary negation of an input of type ComplexPolar
PI Returns a double-precision approximation of the matematical constant ๐… โ‰ˆ 3.14159265358979323846
PlusC Returns the sum of two inputs of type Complex.
PlusCP Returns the sum of two inputs of type ComplexPolar.
PNorm Returns the L(p) norm of a vector of Doubles. That is, given an array x of type Double[], this returns the p-norm $|xฬ„|โ‚š$= (โˆ‘(xแตข)แต–)ยนแŸแต–.
PNormalized Normalizes a vector of Doubles in the L(p) norm. That is, given an array x of type Double[], this returns an array where all elements are divided by the p-norm $|xฬ„|โ‚š$. Function leaves array with norm 0 unchanged.
PowC Returns a number raised to a given power of type Complex. Note that this is a multi-valued function, but only one value is returned.
PowCP Returns a number raised to a given power of type ComplexPolar. Note that this is a multi-valued function, but only one value is returned.
RealMod Computes the modulus between two real numbers.
Round Returns the nearest integer to the specified number. For example: Round(3.7) = 4; Round(-3.7) = -4
SignD Returns -1, 0 or +1 that indicates the sign of a number.
SignI Returns -1, 0 or +1 that indicates the sign of a number.
SignL Returns -1, 0 or +1 that indicates the sign of a number.
Sin Returns the sine of the specified angle.
Sinh Returns the hyperbolic sine of the specified angle.
SmallestFixedPoint Returns the smallest representable number for specific fixed point dimensions.
Sqrt Returns the square root of a specified number.
SquaredNorm Returns the squared 2-norm of a vector.
Tan Returns the tangent of the specified angle.
Tanh Returns the hyperbolic tangent of the specified angle.
TimesC Returns the product of two inputs of type Complex.
TimesCP Returns the product of two inputs of type ComplexPolar.
TrailingZeroCountI For a non-zero integer a, returns the number of trailing zero bits in the binary representation of a.
TrailingZeroCountL For a non-zero integer a, returns the number of trailing zero bits in the binary representation of a.
Truncate Returns the integral part of a number. For example: Truncate(3.7) = 3; Truncate(-3.7) = -3