Posts: 591
Threads: 150
Joined: Sep 2013
Reputation:
0
random(5);
does this include 'zero' too ??
Posts: 1,781
Threads: 13
Joined: Sep 2009
Reputation:
0
yes. the result will be a number from 0 to n-1 (inclusive), therefore the 5 is omitted.
it might help to take the parameter as a modulus operator for easy remembering