5.7.4 Random integers: rand
(See also subsection 8.3.1.)
rand takes as argument an integer n or no argument.
-
rand(n) returns a random integer p such that 0 ≤ p<n.
Input:
rand(10)
Output for example:
8
- rand() returns a random integer p such that 0 ≤ p<231
(or on 64 bits architecture 0 ≤ p<263).
Input:
rand()
Output for example:
846930886