JCL Help:HarmonicMean

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Calculates the harmonic mean of an array of floats.


Pascal

 function HarmonicMean(const X: TDynFloatArray): Float;


Parameters

Parameters Description
const X: TDynFloatArray The array of floats for which to calculate the harmonic mean. The array cannot be empty and must contain only elements with a value greater than zero. The comparison to 0 is made based on the PrecisionTolerance global variable. If any of the elements do not conform to this constraint the function raises an EMathError exception.


Return Value

The harmonic mean of the array of floats.


Description

HarmonicMean calculates the harmonic mean of an array of floats. The harmonic mean is defined as the number of elements divided by the sum of the reciprocal of the elements. The supplied array may not be empty nor may it contain 0 valued elements. If either of these constraints are not met the function raises an EMathError exception.


About

Unit

JclStatistics


Donator

ESB Consultancy


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page