Skip to content

StatisticsUtility

Namespace: SideXP.Core

public static class StatisticsUtility

Miscellaneous utility functions for calculating statistics.

Methods

Sum(IEnumerable<float>)

public static float Sum(IEnumerable<float> values)

Calculates the sum from given values.

Parameters

  • values: The values to sum.

Returns

Returns the calculated value.

Sum(IEnumerable<int>)

public static int Sum(IEnumerable<int> values)

Calculates the sum from given values.

Parameters

  • values: The values to sum.

Returns

Returns the calculated value.

Average(IEnumerable<float>)

public static float Average(IEnumerable<float> values)

Calculates the average value from given ones.

Parameters

  • values: The values of which to calculate the average.

Returns

Returns the calculated value, or 0 if the sequence is empty.

Average(IEnumerable<int>)

public static float Average(IEnumerable<int> values)

Calculates the average value from given ones.

Parameters

  • values: The values of which to calculate the average.

Returns

Returns the calculated value, or 0 if the sequence is empty.