The arithmetic built-in functions allow you to determine properties of arithmetic values (for example, the SIGN function indicates the sign of an arithmetic variable) and to perform routine arithmetic operations.
Table 1 lists the arithmetic built-in functions and a short description of each.
Some of the arithmetic functions derive the data type of their results from one or more arguments. When the data types of the arguments differ, they are converted as described in Data conversion.
Function | Description |
---|---|
ABS | Calculates the absolute value of a value |
CEIL | Calculates the smallest integer value greater than or equal to a value |
COMPLEX | Returns the complex number with given real and imaginary parts |
CONJG | Returns the complex conjugate of a value |
FLOOR | Calculates the largest integer value less than or equal to a value |
IMAG | Returns the imaginary part of a complex number |
MAX | Calculates the maximum of 2 or more values |
MAXVAL | Returns the maximum value for a numeric operand |
MIN | Calculates the minimum of 2 or more values |
MINVAL | Returns the minimum value for a numeric operand |
MOD | Returns the modular equivalent of the remainder of one value divided by another |
RANDOM | Returns a pseudo-random value |
REAL | Returns the real part of a complex number |
REM | Calculates the remainder of one value divided by another |
ROUND | Rounds a value at a specified digit |
ROUNDAWAYFROMZERO |
Rounds a decimal value at a specified digit |
ROUNDTOEVEN | Returns a value rounded to its nearest even value |
SIGN | Returns a -1, 0 or 1 if a value is negative, zero, or positive, respectively |
TRUNC | Calculates the nearest integer for value rounded towards zero |