Gamma Function |
Unit
QESBPCSMath
Declaration
Function Gamma(const X: Extended): Extended;
Description
Defined for all values of X except negative integers and 0.
Accuracy: Gives about 15 digits.
Parameters |
X | Value to process. |
Category
Arithmetic Routines for FloatsImplementation
function Gamma (const X: Extended): Extended; var Z: Extended; begin if FloatIsZero (X) or (FloatIsNegative (X) and SameFloat (X, Int (X))) then raise EMathError.Create (rsNotDefinedForValue); Z := InverseGamma (X); if FloatIsZero (Z) then raise EMathError.Create (rsNotDefinedForValue); Result := 1 / Z; End; |
|