int rand (int seed) /* return a 16-bit random number */
Description
The rand function returns a random number in the range 0 to
+32767. The random number generator is reinitialized each time a
non-zero value is passed in the seed argument. You may use the
rand function to delay for a random number of clock cycles or
to generate random data to feed into a particular algorithm or input
routine.
Return Value
The rand function returns and int value to the
caller.
Example
>rand (0x1234) /* Initialize random generator with 0x1234 */
0x3B98
>rand (0) /* No initialization */
0x64BD
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.