AVG |
avg allows you to find the average of a series of numeric variables.
avg (exprg_list)
|
Element |
Description |
Remarks |
|
exprg_list |
List of generalized_expressions separated by a comma (,) |
All expressions must be numeric. |
# Average of several numeric expressionsCA_MOYEN = avg( CA_MENSUEL(1..12) )
avg allows you to calculate the average of any number of variables or numeric expressions, i.e., their sum divided by the
number of elements in the list.You can mix description, decimal, integer, floating, and dual-precision variables.The type of result depends on the type of parameters and how great the result is. It may be Integer if all elements areof the Integer type and if the sum is divisible by the number of elements; Double if there is at least one Double in the series of parameters; Decimalin other cases.If one of the function's parameters is a variable that was sized with no index or index interval precision, then all of the variable'selements are used. The precision of an index or of an index interval determines the elements to be considered.If you give an index interval since there is not a single element for which you can calculate the average, e.g., avg(VALEURS(1..0)), the
result returned is zero (0).
|
Error |
Description |
|
ERMODE (10) |
- The indexes given are not
numeric. |
|
ERINDI (8) |
Range Error for Indexes |
|
ERDOM (50) |
The parameters are not numeric. |
|
ERDIM (55) |
Too many dimensions given |
MIN - MAX - SUM - PRD - VAR - UNI - FIND
|
|