dynAvg()

Returns the average of the elements of the dynamic field x.

Synopsis

float dynAvg(<dyn_type> x [, dyn_bool mask]);

Parameters

Parameter Meaning
x dynamic field from which the calculation is made
mask masking field

Return Value

average of the element, -1 in the event of an error

Errors

An error message is issued in the event of missing or incorrect arguments.

Description

Returns the average of the elements of the dynamic field x. For <dyn_type> either dyn_int, dyn_uint or dyn_float can be used. The optional argument mask has the same function as in dynMax().

Example

main()
{
dyn_int di;
di=makeDynInt(120,80);
DebugN("Avg:",dynAvg(di)); // 100
}

Assignment

Dynamic fields

Availability

CTRL