Difference between revisions of "RandomG"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function RandomG(const Range: Integer; const Variance: Extended): Integer; </source> ==Availability== SCAR Divi 3.28 > Current ...") |
(No difference)
|
Latest revision as of 22:56, 2 November 2011
Definition
function RandomG(const Range: Integer; const Variance: Extended): Integer;
Availability
SCAR Divi 3.28 > Current
Description
Returns a random number from 0 to Range - 1 using normal distribution with a given Variance. If the variance is lower, the random values will have bigger chance of being closer to 0. The algorithm to calculate this is based on the Gaussian function.
Example
var i: Integer; begin for i := 1 to 10 do WriteLn(RandomG(100, 2)); end.