Skip to main content

Math Functions

Functions for arithmetic operations and numeric calculations.

Add

Adds two or more numeric values.

PropertyValue
CategoryMath
Min Arguments2
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to addinteger, decimal, float, moneyValues to sum

Description: Returns the sum of all arguments. The return type is promoted to the highest weight type among the inputs.

Example:

Add(10, 20, 30) → 60
Add(100.50, 50.25) → 150.75
Add(Price, Tax, Shipping) → Total

Subtract

Subtracts numeric values.

PropertyValue
CategoryMath
Min Arguments2
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to subtractinteger, decimal, float, moneyValues to subtract

Description: Subtracts all subsequent values from the first value: result = first - second - third - ...

Example:

Subtract(100, 30) → 70
Subtract(1000, 100, 50, 25) → 825
Subtract(GrossAmount, Tax, Discount) → NetAmount

Multiply

Multiplies numeric values.

PropertyValue
CategoryMath
Min Arguments2
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to multiplyinteger, decimal, float, moneyValues to multiply

Description: Returns the product of all arguments.

Example:

Multiply(5, 10) → 50
Multiply(Quantity, UnitPrice) → LineTotal
Multiply(Principal, 1.05) → PrincipalWithInterest

Divide

Divides numeric values.

PropertyValue
CategoryMath
Min Arguments2
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to divideinteger, decimal, float, moneyValues to divide

Description: Divides the first value by subsequent values: result = first / second / third / ...

Rules:

  • Divisor cannot be zero (will cause an error)

Example:

Divide(100, 4) → 25
Divide(Total, Quantity) → UnitPrice
Divide(AnnualSalary, 12) → MonthlySalary

Modulo

Returns the remainder after division.

PropertyValue
CategoryMath
Min Arguments2
Max Arguments2
ReturnsSame type as dividend

Arguments:

#NameTypeDescription
0Dividendinteger, decimal, float, moneyNumber to divide
1DivisorintegerNumber to divide by (must be positive)

Description: Returns the remainder when dividend is divided by divisor.

Rules:

  • Divisor must be a positive integer
  • Result type matches the dividend's type
  • Result is always non-negative

Example:

Modulo(17, 5) → 2
Modulo(100, 7) → 2
Modulo(RecordNumber, 2) → 0 or 1 (even/odd check)

Raise to Power

Raises a base number to an exponent.

PropertyValue
CategoryMath
Min Arguments2
Max Arguments2
ReturnsSame type as base

Arguments:

#NameTypeDescription
0Baseinteger, decimal, float, moneyThe base number
1ExponentintegerThe power to raise to

Description: Returns base raised to the power of exponent (base^exponent).

Rules:

  • Exponent must be an integer
  • Zero raised to any positive exponent is zero
  • Any number raised to 0 is 1

Example:

Raise to Power(2, 3) → 8
Raise to Power(10, 2) → 100
Raise to Power(1.05, 12) → 1.795856... (compound interest)

Max Value

Returns the largest value among the arguments.

PropertyValue
CategoryMath
Min Arguments1
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to compareinteger, decimal, float, moneyValues to compare

Description: Returns the numerically largest value. If multiple values are equal and maximal, returns the first occurrence.

Example:

Max Value(10, 25, 15) → 25
Max Value(Price1, Price2, Price3) → highest price
Max Value(RequestedAmount, MinimumAmount) → at least minimum

Min Value

Returns the smallest value among the arguments.

PropertyValue
CategoryMath
Min Arguments1
ReturnsHighest weight numeric type

Arguments:

#NameTypeDescription
0+Number to compareinteger, decimal, float, moneyValues to compare

Description: Returns the numerically smallest value.

Example:

Min Value(10, 25, 15) → 10
Min Value(Stock, OrderQuantity) → available to ship
Min Value(CreditLimit, RequestedAmount) → approved amount

Random

Generates a random integer within a range.

PropertyValue
CategoryMath
Min Arguments2
Max Arguments2
Returnsinteger

Arguments:

#NameTypeDescription
0Lower boundintegerMinimum value (inclusive)
1Upper boundintegerMaximum value (inclusive)

Description: Returns a random integer between lower and upper bounds (inclusive). Distribution is uniform.

Example:

Random(1, 100) → random number between 1 and 100
Random(0, 9) → random single digit
Random(1, 6) → simulates a dice roll