random.integer

random.integer(max: number) 🡒 number, pure function

Returns an integer in the segment [1,max][1,max] where maxmax is the inclusive upper bound.

table T = with
[| as Max |]
[| 1 |]
[| 5 |]
[| 50 |]
[| 500 |]
 
T.K = random.integer(T.Max)
 
show table "" a1b5 with T.Max, T.K
1 2 3 4 5 6 7 8 9 10

The argument of random.integer must be greater or equal to 1.

random.integer(min: number, max: number) 🡒 number, pure function

Returns an integer in the segment [min,max][min,max] where minmin and maxmax are the inclusive lower and upper bound respectively.

table T = with
[| as Min, as Max |]
[| 1, 10 |]
[| -10, 1 |]
[| -10, 10 |]
 
T.K = random.integer(T.Min, T.Max)
 
show table "" a1b5 with T.Min, T.Max, T.K
1 2 3 4 5 6 7 8 9
User Contributed Notes
0 notes + add a note