random
Generates a random integer number. Biggest range (from lower to upper boundary) is 2^31-1.
Indirect parameter passing is disabled
1, 2
No. | Type | Description |
---|---|---|
1. input |
numeral | 1st boundary value If specified alone, then random numbers returned lie between 0 and specified value. |
Opt. 2. input |
numeral | 2nd boundary value If specified, then it will serve as 2nd boundary value. It does not matter if it is smaller or greater than the 1st boundary value. |
Type | Description |
---|---|
numeral | Random number Randomly generated number |
Values provided is not a numerals
for (i[]=1, i[]<=10, i[]++) print( random(1000), " " ); echo;
for (i[]=1, i[]<=10, i[]++) print( random( 1000, 950), " " ); echo;
for (i[]=1, i[]<=10, i[]++) print( random(-1000, -950), " " ); echo;
for (i[]=1, i[]<=10, i[]++) print( random( -5, 3), " " ); echo;
for (i[]=1, i[]<=10, i[]++) print( random( -1, 1), " " ); echo;
791 198 451 106 363 180 716 350 353 966
980 958 985 989 999 994 976 952 988 988
-992 -983 -971 -963 -979 -991 -957 -952 -969 -992
-4 1 -2 2 -4 3 -2 0 0 -1
-1 1 1 -1 1 0 1 -1 0 -1