n-Argument Operators

Home, Up: Operators and Constants

 

n-argument operators consider all values to their left as their arguments, either to the beginning of the calculation line or to the n-argument delimiter | (see below) and replace them and themselves with the result of the operation.

 

On this page:

Statistical Operators, The ITEM Operator, The n-Argument Delimiter, Notes.

 

Statistical Operators

N means "number of arguments"

N+ means "number of positive values"

N0 means "number of zeros"

N- means "number of negative values"

SUM means "sum of all values"

MEAN means "mean value"

GMEAN means "geometric mean" (all values must be larger than 0)

HMEAN means "harmonic mean" (all values must be larger than 0)

MEDIAN means "median"

SDEV means "standard deviation"

SQSUM means "sum of squares"

RCPSUM means "sum of reciprocals" (no value must be zero)

PROD means "product of all values"

MIN means "minimum value"

MAX means "maximum value"

 

The ITEM Operator

The ITEM operator is a special n-argument operator that returns the value of a single item from its list of arguments.

The index of this item is the value immediately to the left of the ITEM operator, it itself is not a part of the list.

If the index is negative items are counted backwards, beginning with the second item to the left of the ITEM operator.

Examples:

1 3 5 7 2 ITEM = 3

1 3 5 7 -2 ITEM = 5

The ITEM operator can be used in a loop, usually with data stored in a user defined element (UDE) and the loop index pseudo-constant I as the index.

In a loop, after the last element of the list has been referenced (or the first element if the index is negative) the loop will be ended.

 

The n-Argument Delimiter |

While n-argument operators take anything to their left as their list of arguments, the vertical bar | can serve as a delimiter, hiding anything to its left from the next n-argument operator.

Anything left to the delimiter remains hidden until an n-argument operator is encountered, and then becomes visible again.

In principle there can be more than one delimiter in a calculation line, but each delimiter must be followed by a corresponding n-argument operator.

Example:

20 | 3 1 4 SUM - = 12

(20 is hidden, the sum of 3, 1 and 4 is 8 which replaces the expression "3 1 4 SUM", then 20 becomes visible again, and 20 minus 8 is 12.)

 

Notes

N+, N0 and N- observe the zero threshold.

.

N-argument-operators need at least one argument, except for N, which can have zero or more, and SDEV and ITEM, which need at least two.

 

Home, Up: Operators and Constants, Prev: 2-Argument Operators, Next: Constants