The avg() function returns the average of a sequence of numbers or durations.
Argument | Data Type | Meaning |
---|---|---|
sequence | xdt:anyAtomicType* | The input sequence. Any untyped atomic values in the input are converted to xs:double values. The resulting sequence must consist entirely of numbers, or entirely of durations of the same kind |
Result | xdt : anyAtomicType ? | The average of the values in the input sequence. This will be a value of the same primitive type as the values in the input sequence. If the input values are xs:integer values, the result will be an xs:decimal |