RND |
rnd(x) returns a random number, between zero (0) and x (excluding x).
rnd(num_exp)
|
Element |
Description |
Restrictions |
|
num_exp |
Numeric Expression |
None |
# Simulation of a throw of diceJET_DE = int(rnd(6)) + 1
# Creation of an alphabetic string of a length of 10 randomly
CH_HASARD = sigma(1, 10, chr$(int(rnd(25))+ASCII("A")))
rnd(X) uses the function of the drand48() mathematical dictionary. The method used calls what comes next X(N+1)=A*X(N)+C (remainder M) with M=2^48, A=25214903917, C=11. The initial value given by Adonix at the startup depends on the local time.
The numbers obtained are distributed uniformly over the interval. If you wish to obtain integers, you may use one of the int, fix, or arr functions.
The result type is Double.
|
Error |
Description |
|
ERMODE (10) |
The parameter is not numeric. |
|
|