id: trandom title: TRandom
Random number generator
By creating multiple TRandom objects, multiple independent random number generators can be used in parallel.
Method RndFloat:Float() AbstractGenerate random float
A random float in the range 0 (inclusive) to 1 (exclusive)
Method RndDouble:Double() AbstractGenerate random double
A random double in the range 0 (inclusive) to 1 (exclusive)
Method Rnd:Double(minValue:Double = 1, maxValue:Double = 0) AbstractGenerate random double
The optional parameters allow you to use Rnd in 3 ways:
| Format | Result |
| `Rnd()` | Random double in the range 0 (inclusive) to 1 (exclusive) |
| `Rnd(x)` | Random double in the range 0 (inclusive) to n (exclusive) |
| `Rnd(x,y)` | Random double in the range x (inclusive) to y (exclusive) |
A random double in the range min (inclusive) to max (exclusive)
Method Rand:Int(minValue:Int, maxValue:Int = 1) AbstractGenerate random integer
The optional parameter allows you to use Rand in 2 ways:
| Format | Result |
| `Rand(x)` | Random integer in the range 1 to x (inclusive) |
| `Rand(x,y)` | Random integer in the range x to y (inclusive) |
A random integer in the range min (inclusive) to max (inclusive)
Method SeedRnd(seed:Int) AbstractSet random number generator seed
Method RndSeed:Int() AbstractGet random number generator seed
Used in conjunction with SeedRnd, RndSeed allows you to reproduce sequences of random numbers.
The current random number generator seed
Method GetName:String() AbstractGets the name of this random number generator