0 / 0
Mathematical functions

# Mathematical functions

The mathematical functions perform mathematical operations.

The mathematical functions are in the Mathematical category of the expression editor. Square brackets indicate that an argument is optional. The examples show the function as it appears in a Derivation field in the Transformer stage.
Abs
Returns the absolute value of any numeric expression. The absolute value of an expression is its unsigned magnitude.
• Input: numeric_expression (int32)
• Output: result (dfloat)
• Examples. If mylink.number1 contains the number 12 and mylink.number2 contains the number 34, then the following two functions are equivalent, and return the number 22:
``````Abs(12-34)
``````
If mylink.number1 contains the number 34 and mylink.number2 contains the number 12, then the following two functions are equivalent, and return the number 22:
``````Abs(34-12)
``````
Acos
Calculates the trigonometric arc-cosine of an expression. The expression must be a numeric value. The result is expressed in radians.
• Input: numeric_expression (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 0.707106781, then the following two functions are equivalent, and return the value 0.785398:
``````Acos(0.707106781)
``````
Asin
Calculates the trigonometric arc-sine of an expression. The expression must be a numeric value. The result is expressed in radians.
• Input: numeric_expression (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 0.707106781, then the following two functions are equivalent, and return the value 0.785398:
``````Asin(0.707106781)
``````
Atan
Calculates the trigonometric arc-tangent of an expression. The expression must be a numeric value. The result is expressed in radians.
• Input: numeric_expression (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 135, then the following two functions are equivalent, and return the value 1.56339, which is the angle that has an arc tangent of 135:
``````Atan(135)
``````
Atan2
Calculates the trigonometric arc-tangent of the two inputs by using the signs of the two inputs to determine the quadrant of the result. The inputs must be numeric values. The result is expressed in radians.
• Input: numeric_expression (dfloat, dfloat)
• Output: result (dfloat)
• Examples. If mylink.number1 contains the number 10.0 and mylink.number2 contains the number -10.0, then the following two functions are equivalent, and return the value 2.35619:
``````Atan2(10.0. -10.0)
Ceil
Calculates the smallest integer value greater than or equal to the given decimal value.
• Input: number (dfloat)
• Output: result (int32)
• Examples. If mylink.number contains the number 2355.66, then the following two functions are equivalent, and return the value 2356:
``````Ceil(2355.66)
``````
Cos
Calculates the trigonometric cosine of an expression. The expression must be a numeric value. The expression must produce a numeric value that is the angle in radians.
• Output: result (dfloat)
• Examples. If mylink.number contains the number 0.785398, then the following two functions are equivalent, and return the value 0.7071:
``````Cos(0.785398)
``````
Cosh
Calculates the hyperbolic cosine of an expression. The expression must be a numeric value.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 2, then the following two functions are equivalent, and return the value 3.7622:
``````Cosh(2)
``````
Div
Outputs the whole part of the real division of two real numbers (dividend, divisor).
• Input: dividend (dfloat), divisor (dfloat)
• Output: result (dfloat)
• Examples. If mylink.dividend contains the number 100, and mylink.divisor contains the number 25, then the following two functions are equivalent, and return the value 4:
``````Div(100,25)
``````
Exp
Calculates the result of base e raised to the power designated by the value of the expression. The value of e is approximately 2.71828. The expression must evaluate to a numeric value.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 5, then the following two functions are equivalent, and return the value 54.5982:
``````Exp(5-1)
``````
Fabs
Calculates the absolute value of the given float value.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number -26.53, then the following two functions are equivalent, and return the value 26.53:
``````Fabs(-26.53)
``````
Floor
Calculates the largest integer value less than or equal to the given decimal value.
• Input: number (dfloat)
• Output: result (int32)
• Examples. If mylink.number contains the number 203.25, then the following two functions are equivalent, and return the value 203:
``````Floor(203.25)
``````
Ldexp
Returns a dfloat value from multiplying the mantissa by 2 raised to the power of the exponent.
• Input: mantissa (dfloat), exponent (int32)
• Output: result (dfloat)
• Examples. If mylink.mantissa contains the number 2, and mylink.exponent contains the number 3, then the following two functions are equivalent, and return the value 16:
``````Floor(2,3)
``````
Llabs
Calculates the absolute value of the given integer value.
• Input: number (integer)
• Output: result (unsigned integer)
• Examples. If mylink.number contains the number -26, then the following two functions are equivalent, and return the value 26:
``````Llabs(-26)
``````
Ln
Calculates the natural logarithm of an expression in base e. The value of e is approximately 2.71828. The expression must evaluate to a numeric value greater than 0.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 6, then the following two functions are equivalent, and return the value 1.79176:
``````Ln(6)
``````
Log10
Returns the logarithm in base 10 of the given value.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 6, then the following two functions are equivalent, and return the value 0.778151:
``````Log10(6)
``````
Max
Returns the greater of the two argument values.
• Input: number1 (int32),number2(int32)
• Output: result (int32)
• Examples. If mylink.number1 contains the number 6, and mylink.number1 contains the number 101, then the following two functions are equivalent, and return the value 101:
``````Max(6,101)
``````
Min
Returns the lower of the two argument values.
• Input: number1 (int32),number2(int32)
• Output: result (int32)
• Examples. If mylink.number1 contains the number 6, and mylink.number1 contains the number 101, then the following two functions are equivalent, and return the value 6:
``````Min(6,101)
``````
Mod
Calculates the modulo (the remainder) of two expressions (dividend, divisor).
• Input: dividend (int32),divisor (int32)
• Output: result (int32)
• Examples. If mylink.dividend contains the number 115, and mylink.divisor contains the number 25, then the following two functions are equivalent, and return the value 15:
``````Mod(115,25)
``````
Neg
Negates a number.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples. If mylink.number contains the number 123, then the following two functions are equivalent, and return the value -123:
``````Neg(123)
``````
Pwr
Calculates the value of an expression when raised to a specified power (expression, power).
• Input: expression (dfloat),power (dfloat)
• Output: result (dfloat)
• Examples. If mylink.expression contains the number 2, and mylink.power contains the number 3, then the following two functions are equivalent, and return the value 8:
``````Pwr(2,3)
``````
Rand
Returns a pseudorandom integer between 0 and 232-1.
• Input: Not applicable
• Output: result (uint32)
• Examples. Use this function to add a column to your output that contains a pseudorandom number:
``Rand()``
Random
Returns a random number between 0 and 232-1.
• Input: Not applicable
• Output: result (uint32)
• Examples. Use this function to add a column to your output that contains a random number:
``Random()``
Sin
Calculates the trigonometric sine of an expression. The expression must be a numeric value. The expression must produce a numeric value that is the angle in radians.
• Output: result (dfloat)
• Examples. If mylink.number contains the number 0.785398, then the following two functions are equivalent, and return the value 0.7071:
``````Sin(0.785398)
``````
Sinh
Calculates the hyperbolic sine of an expression. The expression must be a numeric value.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples: If mylink.number contains the number 2, then the following two functions are equivalent, and return the value 3.62686:
``````Sinh(2)
``````
Sqrt
Calculates the square root of a number.
• Input: number (dfloat)
• Output: result (dfloat)
• Examples: If mylink.number contains the number 450, then the following two functions are equivalent, and return the value 21.2132:
``````Sqrt(450)
``````
Tan
Calculates the trigonometric tangent of an expression. The expression must produce a numeric value that is the angle in radians.
• Output: result (dfloat)
• Examples. If mylink.number contains the number 0.7853981, then the following two functions are equivalent, and return the value 0.7071:
``````Tan(0.7853981)
``````Tanh(2)