Returns the harmonic mean of the elements of an array.
Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (Extreme.Numerics)
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Function HarmonicMean ( _ data As Double() _ ) As Double |
| C# |
|---|
public static double HarmonicMean ( double[] data ) |
| C++ |
|---|
public: static double HarmonicMean ( array<double>^ data ) |
Parameters
- data ()
- A Double array.
Return Value
The harmonic mean of the elements of data.
Remarks
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the data values.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | data is nullNothingnullptr. |