RandG

From SCAR Divi Manual
Revision as of 22:46, 19 October 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function RandG(const Variance: Extended): Extended; </source> ==Availability== SCAR Divi 3.28 > Current ==Description== Genera...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function RandG(const Variance: Extended): Extended;

Availability

SCAR Divi 3.28 > Current

Description

Generates a random extended value from the range [0, 1] using normal distribution with a given Variance. If the variance is lower, the random values will have bigger change of being closer to 0. The algorithm to calculate this is based on the Gauss function.

Example

var
  i: Integer;

begin
  for i := 1 to 100 do
    WriteLn(RandG(2));
end.

See Also