Several options can occur, however. If no number is passed, a random number from 0 to RAND_MAX is returned. If a negative number is passed, RAND_MAX is returned. If a positive number is passed, the random number generator is re-seeded.
Number |
INDEX NIL NEGATIVE POSITIVE |
Base value. If X < 0, –X is used. |
|
Result | INDEX |
Random number if Number is NIL RAND_MAX if Number is negative NIL if Number is positive |