Math Functions
Math functions in FlowOn Logic provide a range of mathematical operations and calculations. These functions empower you to perform various mathematical tasks, including basic arithmetic operations (addition, subtraction, multiplication, division, count, max, min, etc ), rounding, absolute value calculations, and more.
With Math functions, you can efficiently manipulate numeric data, make complex calculations, and create formulas to address various mathematical requirements within your functions.
Add
Returns the result of adding two numbers.
Add(<Number1>, <Number2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number1 | Yes | Number | The first number to be added. |
| Number2 | Yes | Number | The second number to be added. |
| Return value | Number | The result of adding the two numbers. |
- Example
Add(5, 3)
Result: 8
Subtract
Returns the result of subtracting two numbers.
Subtract(<Number1>, <Number2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number1 | Yes | Number | The first number from which the second number will be subtracted. |
| Number2 | Yes | Number | The second number to subtract from the first number. |
| Return value | Number | The result of subtracting the second number from the first number. |
- Example
Subtract(15,10)
Result: 5
Divide
Returns the result of dividing two numbers.
Divide(<Dividend>, <Divisor>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Dividend | Yes | Number | The number to be divided. |
| Divisor | Yes | Number | The divisor. |
| Return value | Number | The result of dividing the first number by the second number. |
- Example
Divide(10,2)
Result: 5
Modulo
Returns the remainder after dividing the first number by the second number
Modulo(<Dividend>, <Divisor>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Dividend | Yes | Number | The number to be divided. |
| Divisor | Yes | Number | The divisor. |
| Return value | Number | The remainder after dividing the first number by the second number (modulo). |
- Example
Modulo(10,3)
Result: 1
Multiply
Returns the result of multiplying two numbers.
Multiply(<Number1>, <Number2>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number1 | Yes | Number | The first number to be multiplied. |
| Number2 | Yes | Number | The second number to be multiplied. |
| Return value | Number | The result of multiplying the two numbers. |
- Example
Multiply(5,4)
Result: 20
Random
Generates a random number between two specified values.
Random(<MinValue>, <MaxValue>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| MinValue | Yes | Number | The minimum value (inclusive) for the generated random number |
| MaxValue | Yes | Number | The maximum value (exclusive) for the generated random number. |
| Return value | Number | A random number between MinValue (inclusive) and MaxValue (exclusive). |
- Example
Random(1,5)
Result: Randomly generated number between 1 and 5, like 3
Max Value
Returns the maximum value in an array of specified numbers.
MaxValue(<Number1>, <Number2>, ...)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number1, Number2, ... | Yes | Number | The numbers to find the maximum value from |
| Return value | Number | The maximum value among the specified numbers. |
- Example
MaxValue(10, 5, 8, 15, 3)
Result: 15
Min Value
Returns the minimum value in an array of specified numbers.
MinValue(<Number1>, <Number2>, ...)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number1, Number2, ... | Yes | Number | The numbers to find the minimum value from |
| Return value | Number | The minimum value among the specified numbers. |
- Example
MinValue(10, 5, 8, 15, 3)
Result: 3
Raise To Power
Returns the result of raising a number to a power you specify.
RaiseToPower(<Number>, <Exponent>)
| Parameter | Required | Type | Description |
|---|---|---|---|
| Number | Yes | Number | The base number to raise to a power. |
| Exponent | Yes | Number | The exponent to which the base number is raised. |
| Return value | Number | The result of raising the base number to the specified exponent. |
- Example
RaiseToPower(2, 3)
Result: 8
What's Next
In this section, we've explored various math functions in FlowOn logic and learned how to apply them effectively. In the next section, we'll delve into date/time functions for further understanding and application.