math.average

Math: Average

Performs average across an array. If $a is an array and $b is an array, each member of $a is averaged against the same member in $b. If $a is an array and $b is a number, each member of $a is averaged agained $b. If $a is an array this array is averaged to one number. If $a is a number and $b is not provided or NULL, $a is gracefully returned as an average value of itself.

Arguments

a

DataType
mixed
Required
false
Description
First number for calculation

fail

DataType
boolean
Required
false
Description
If TRUE, throws an Exception if argument “a” is not specified and no child content or inline argument is found. Usually okay to use a NULL value (as integer zero).

b

DataType
mixed
Required
false
Description
Optional: Second number or Iterator/Traversable/Array for calculation