Skip to content

average

In std/collections.

reduction fn average(self: Collection<Int>) : Option<Float>
reduction fn average(self: Collection<Float>) : Option<Float>
reduction fn average(self: Collection<Decimal>) : Option<Decimal>

The mean of the occurrences, or none over []: [1, 2] | average is 1.5. Ints and Floats average to a Float; a Decimal mean is the sum divided by the count, as Decimal / divides.