The following table describes arithmetic functions. The binary arithmetic functions like Add, Subtract, and Multiply return a result type that is the higher resolution type of the two parameters. For example, Add(Integer, Long)
returns Long. Multiply(Integer, Double)
returns Double. The Divide
function always returns Double.
Function |
Description |
---|---|
Absolute |
Returns the absolute value (its numerical value without regard to its sign) of the numeric argument. Arguments are integer, long integer, or double. |
Add |
Returns the result of adding the two numeric arguments together. Arguments are integer, long integer, or double types. |
Ceil |
Returns the smallest integer value that is not less than the numeric argument. Arguments are integer, long integer, or double. |
Divide |
Returns the result of dividing the first numeric argument by the second numeric argument. Arguments are integer, long integer, or double types; but the second argument must not evaluate to 0. |
Floor |
Returns the largest integer value that is not greater than the numeric argument. Arguments are integer, long integer, or double. |
Returns the result of the evaluation of the specified Java expression. Java Mathematical Expressions are for advanced users. ESM does not provide error checking and messaging for your JEP (Java expression parser) expressions. Refer to the Java math expressions parser web pages at http://www.singularsys.com/jep/ for more information on writing these expressions. Supported Expressions: ESM supports a subset of Java mathematical expressions parser (JEP), which are written like standard mathematical expressions. A JEP expression has three components: operator, function, and value.
Example The expression |
|
|
Notes:
|
Multiply |
Returns the product of multiplying the two numeric arguments together. The arguments may be integer, long integer, or double types. |
Round |
Returns the closest integer to the numeric argument. The argument must be a double. |
RoundN |
Takes two arguments, the double number to be rounded off and the number of decimal places from 0 to 5. Rounds off the input double number to the specified number of decimal places. For example: If the double is The double is rounded off to |
Subtract |
Returns the result of subtracting the second numeric argument from the first numeric argument. The arguments may be integer, long integer, or double types. |