Class Pseudorandom
Provides thread-safe pseudorandom number generation using cryptographically secure seeds.
Inherited Members
Namespace: EarleyParser
Assembly: EarleyParser.dll
Syntax
public static class Pseudorandom
Remarks
This class uses a combination of cryptographic random number generation for seeding and thread-local storage to ensure thread safety. Each thread gets its own Random instance initialized with a cryptographically secure seed.
Methods
| Edit this page View SourceNextDouble()
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
Declaration
public static double NextDouble()
Returns
| Type | Description |
|---|---|
| double | A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0. |
NextInt()
Returns a non-negative random integer.
Declaration
public static int NextInt()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is greater than or equal to 0 and less than MaxValue. |
NextInt(int)
Returns a non-negative random integer that is less than the specified maximum.
Declaration
public static int NextInt(int range)
Parameters
| Type | Name | Description |
|---|---|---|
| int | range | The exclusive upper bound of the random number to be generated. |
Returns
| Type | Description |
|---|---|
| int | A random integer that is greater than or equal to 0, and less than range. |