System.Random
E697482
System.Random is a .NET class that provides methods for generating pseudo-random numbers for use in applications.
Statements (49)
| Predicate | Object |
|---|---|
| instanceOf |
.NET class
ⓘ
class ⓘ pseudo-random number generator ⓘ |
| algorithmType | linear congruential generator (LCG)-style ⓘ |
| assembly |
System.Runtime
NERFINISHED
ⓘ
mscorlib NERFINISHED ⓘ |
| baseType | System.Object NERFINISHED ⓘ |
| canBeSubclassed | true ⓘ |
| constructor |
Random()
ⓘ
Random(int seed) ⓘ |
| defaultConstructor | Random() ⓘ |
| designGuideline | recommended to create one instance and reuse it ⓘ |
| distribution | uniform distribution over specified ranges ⓘ |
| documentationUrl | https://learn.microsoft.com/dotnet/api/system.random ⓘ |
| extension | can be extended by overriding Sample() to change distribution ⓘ |
| introducedIn | .NET Framework 1.0 NERFINISHED ⓘ |
| isAbstract | false ⓘ |
| isDeterministicWithSameSeed | true ⓘ |
| isPublic | true ⓘ |
| isSealed | false ⓘ |
| isSerializable |
false in .NET Core by default
ⓘ
true in .NET Framework ⓘ |
| isThreadSafe | false ⓘ |
| languageBinding |
C#
NERFINISHED
ⓘ
F# ⓘ VB.NET NERFINISHED ⓘ |
| library |
.NET 5+
NERFINISHED
ⓘ
.NET Core NERFINISHED ⓘ .NET Framework NERFINISHED ⓘ |
| method |
double NextDouble()
ⓘ
int Next() ⓘ int Next(int maxValue) ⓘ int Next(int minValue, int maxValue) ⓘ protected virtual double Sample() ⓘ void NextBytes(Span<byte> buffer) ⓘ void NextBytes(byte[] buffer) ⓘ |
| namespace | System NERFINISHED ⓘ |
| notSuitableFor | cryptographic randomness ⓘ |
| outputRange |
Next() returns Int32 in range [0, Int32.MaxValue)
ⓘ
Next(int maxValue) returns Int32 in range [0, maxValue) ⓘ Next(int minValue, int maxValue) returns Int32 in range [minValue, maxValue) ⓘ NextDouble() returns Double in range [0.0, 1.0) ⓘ |
| overridableMethod | Sample() ⓘ |
| relatedClass |
System.Random.Shared
NERFINISHED
ⓘ
System.Security.Cryptography.RandomNumberGenerator NERFINISHED ⓘ |
| seedSource | time-dependent default seed when using Random() constructor ⓘ |
| staticProperty | Random Shared ⓘ |
| staticPropertyType | Random Shared is thread-safe ⓘ |
| usage | general-purpose pseudo-random number generation ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.