You can use numeric intrinsic functions only in places where numeric expressions are allowed. These functions can save you time because you don't have to code the many common types of calculations that they provide.
Numeric intrinsic functions return a signed numeric value, and are treated as temporary numeric data items.
Numeric functions are classified into the following categories:
You can use intrinsic functions to perform several different arithmetic operations, as outlined in the following table.
| Number handling | Date and time | Finance | Mathematics | Statistics |
|---|---|---|---|---|
LENGTH |
CURRENT-DATE |
ANNUITY |
ACOS |
MEAN |
Examples: numeric intrinsic functions
You can reference one function as the argument of another. A nested function is evaluated independently of the outer function (except when the compiler determines whether a mixed function should be evaluated using fixed-point or floating-point instructions).
You can also nest an arithmetic expression as an argument to a numeric function. For example, in the statement below, there are three function arguments (a, b, and the arithmetic expression (c / d)):
Compute x = Function Sum(a b (c / d))
You can reference all the elements of a table (or array) as function arguments by using the ALL subscript.
You can also use the integer special registers as arguments wherever integer arguments are allowed.
Many of the capabilities of numeric intrinsic functions are also provided by Language Environment callable services.
related concepts
Fixed-point contrasted with floating-point arithmetic
Intermediate results and arithmetic precision
related references
ARITH