RandomNumber

Description

sealed class Tinman.Core.Util.RandomNumber

A generator for pseudo random numbers.

Public / Constructors

Random​Number


public constructor RandomNumber → (1)

seed in : int32

The random number seed value to use.

Creates a new instance of RandomNumber.

Public / Methods

Bool


public method Bool → ()

returns → bool

The random value.

Returns a random boolean value.

Float32

2 overloads


public method Float321 → ()

returns → float32

The random number.

Returns a random 32-bit floating-point number in the range [0..1].


public method Float322 → (2)

minimum in : float32

Lower bound of range.

maximum in : float32

Upper bound of range.

returns → float32

The random number.

Returns a random 32-bit floating-point number in the given range.

Float64

2 overloads


public method Float641 → ()

returns → float64

The random number.

Returns a random 64-bit floating-point number in the range [0..1].


public method Float642 → (2)

minimum in : float64

Lower bound of range.

maximum in : float64

Upper bound of range.

returns → float64

The random number.

Returns a random 64-bit floating-point number in the given range.

Int32

2 overloads


public method Int321 → ()

returns → int32

The random number.

Returns a random 32-bit integer positive number.


public method Int322 → (2)

minimum in : int32

The minimum value, inclusive.

maximum in : int32

The maximum value, inclusive.

returns → int32

The random number.

Returns a random 32-bit integer number in the given range.

Int64

2 overloads


public method Int641 → ()

returns → int64

The random number.

Returns a random 64-bit integer positive number.


public method Int642 → (2)

minimum in : int64

The minimum value, inclusive.

maximum in : int64

The maximum value, inclusive.

returns → int64

The random number.

Returns a random 32-bit integer number in the given range.

Normal


[Pure]
public method Normal → (2)

mean opt : float64 = 0

The expected mean value.

deviation opt : float64 = 1

The standard deviation.

returns → float64

The random value, clamped to the interval (mean opt +/- 4 * deviation opt).

Returns a random value of the given normal-distribution.

Regarding the set of possible random values,
the interval (mean opt +/- 1 * deviation opt) contains 68.27%,
the interval (mean opt +/- 2 * deviation opt) contains 95.45%,
the interval (mean opt +/- 3 * deviation opt) contains 99.73%.