fn:avg

fn:avg(anyAtomicType* $srcval) → anyAtomicType?

Function signature

$srcval

xdt:anyAtomicType *

Result

xdt:anyAtomicType ?

Returns the average of a set of numbers or durations

XPath 2.0 Specification

Implemented. Changed in 7.4 to return the same type as the argument, when appropriate. (For a set of integers, the result is a decimal). Changed in 8.1 to provide the average over a sequence of durations.

Expand

Up  Next