DefaultRandomProvider
Ecng.Common
The source used where nobody needs the series back.
Реализует: IRandomProvider
Свойства
Instance
public static DefaultRandomProvider Instance { get; }
value = DefaultRandomProvider.Instance
The shared instance, for callers that only want a value and have nothing to reproduce.
Методы
Next
public int Next(int min, int max)
result = defaultRandomProvider.Next(min, max)
Returns a value in the range, both ends included.
- min
- Smallest value that may be returned.
- max
- Largest value that may be returned.
Возвращает: A value between and .
NextBytes
public void NextBytes(byte[] buffer)
defaultRandomProvider.NextBytes(buffer)
Fills the buffer with random bytes.
- buffer
- Buffer to fill.
NextDouble
public double NextDouble()
result = defaultRandomProvider.NextDouble()
Returns a value in [0, 1).
Возвращает: A value from zero up to but not including one.
NextLong
public long NextLong(long min, long max)
result = defaultRandomProvider.NextLong(min, max)
Returns a value in the range, both ends included.
- min
- Smallest value that may be returned.
- max
- Largest value that may be returned.
Возвращает: A value between and .