Record TGenericRandomNumberGenerator

Hierarchy
Fields
Properties

Unit

Declaration

type generic TGenericRandomNumberGenerator<TQWordGenerator> = record

Description

Generic random number generator. Turns any qword generating RNG into a RNG for other types

Overview

Methods

Public procedure randomize;
Public procedure randomize(seed: QWord);
Public function nextQWord: QWord; inline;
Public function nextDouble: Double;
Public function next(const l: longint): longint;
Public function next(const l: qword): qword;
Public function next(const l: int64): int64;
Public procedure shuffle(var a: array of integer);
Public procedure shuffle(var a: array of int64);

Description

Methods

Public procedure randomize;

Initializes the RNG

Public procedure randomize(seed: QWord);

Initializes the RNG with a seed

Public function nextQWord: QWord; inline;

Returns a random QWord

Public function nextDouble: Double;

Returns a random double between 0 and 1

Public function next(const l: longint): longint;

Returns a random number in [0, l[

Public function next(const l: qword): qword;

Returns a random number in [0, l[

Public function next(const l: int64): int64;

Returns a random number in [0, l[

Public procedure shuffle(var a: array of integer);

Orders an array randomly

Public procedure shuffle(var a: array of int64);

Orders an array randomly


Generated by PasDoc 0.16.0.