| Random_Weibull Routines |
Unit
QESBPCSRandom
| Overloaded Variants |
| Function Random_Weibull(const a: Extended): Extended; |
| Function Random_Weibull(const a: Extended; RandomGenerator: TRandomGenFunction): Extended; |
Declaration
Function Random_Weibull(const a: Extended): Extended;
| Parameters |
| a | Parameter for Weibull Distribution. Cannot be 0. |
| RandomGenerator | Optional Function to use for Uniform Random Number Generator. If omitted, Delphi's Random function is used, and if this is done remember to call Randomize if you don't want repeated values. |
Category
Arithmetic Routines for FloatsImplementation
function Random_Weibull (const a: Extended): Extended;
begin
Result := Random_Weibull (a, DelphiRandom);
End; |
Declaration
Function Random_Weibull(const a: Extended; RandomGenerator: TRandomGenFunction): Extended;Implementation
function Random_Weibull (const a: Extended;
RandomGenerator: TRandomGenFunction): Extended;
begin
if Abs (a) <= VSmall then
raise EMathError.Create (rsInvalidValue);
Result := XtoY (Random_Exponential (RandomGenerator), 1.0 / a);
End; |
|
|