C# Class NSoft.NFramework.Collections.C5.C5Random

A modern random number generator based on G. Marsaglia: Seeds for Random Number Generators, Communications of the ACM 46, 5 (May 2003) 90-93; and a posting by Marsaglia to comp.lang.c on 2003-04-03.
Inheritance: System.Random
Afficher le fichier Open project: debop/NFramework

Méthodes publiques

Méthode Description
C5Random ( ) : System

Create a random number generator seed by system time.

C5Random ( long seed ) : System

Create a random number generator with a given seed

Next ( ) : int

Get a new random System.Int32 value

Next ( int max ) : int

Get a random non-negative integer less than a given upper bound

Next ( int min, int max ) : int

Get a random integer between two given bounds

NextBytes ( byte buffer ) : void

Fill a array of byte with random bytes

NextDouble ( ) : double

Get a new random System.Double value

Méthodes protégées

Méthode Description
Sample ( ) : double

Get a new random System.Double value

Private Methods

Méthode Description
C5Random ( uint Q ) : System
Cmwc ( ) : uint

Method Details

C5Random() public méthode

Create a random number generator seed by system time.
public C5Random ( ) : System
Résultat System

C5Random() public méthode

Create a random number generator with a given seed
If seed is zero
public C5Random ( long seed ) : System
seed long The seed
Résultat System

Next() public méthode

Get a new random System.Int32 value
public Next ( ) : int
Résultat int

Next() public méthode

Get a random non-negative integer less than a given upper bound
If max is negative
public Next ( int max ) : int
max int The upper bound (exclusive)
Résultat int

Next() public méthode

Get a random integer between two given bounds
If max is less than min
public Next ( int min, int max ) : int
min int The lower bound (inclusive)
max int The upper bound (exclusive)
Résultat int

NextBytes() public méthode

Fill a array of byte with random bytes
public NextBytes ( byte buffer ) : void
buffer byte The array to fill
Résultat void

NextDouble() public méthode

Get a new random System.Double value
public NextDouble ( ) : double
Résultat double

Sample() protected méthode

Get a new random System.Double value
protected Sample ( ) : double
Résultat double