Choose a random integer in MEL?

Choose a random integer in MEL?

Anonymous
Not applicable
4,621 Views
1 Reply
Message 1 of 2

Choose a random integer in MEL?

Anonymous
Not applicable
In MEL is there a way to choose a random integer value from a selection ?

eg

rand (0,1) - returns either 0 or 1
rand (1-5) - returns any of (1,2,3,4,5)
0 Likes
4,622 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Hello, you can just do this:


int $i = rand(0,10)


this will give you random numbers 0,1,2,3,4,5,6,7,8,9,
Note that it won't give you 10.

just as a side note, if you want this to work with floats, you just have to have this:


float $i = rand(0,10)