Skip to content

Math.Mean

Name Mandatory Description Default Type
⬅️ Input The sequence of floating point numbers to calculate the average of. [Float]
Output ➡️ The calculated average as a float. Float
Kind No The type of average to calculate. Mean::Arithmetic Mean

Calculates the average value of a sequence of floating point numbers.

Details

This shard calculates the average of the sequence of floats differently depending on what was specified in the Kind parameter. - Arithmetic: sum divided by count - Geometric: nth root of product - Harmonic: reciprocal of average of reciprocals

Examples

1
2
[-1.0 0.0 1.0 2.0 5.0] | Math.Mean(Kind: Mean::Arithmetic) | Log
Assert.Is(1.4 Break: true)

[info] [sample-wire] 1.4