Keil Logo

rand

概要
int rand (int seed)  /* return a 16-bit random number */
説明

rand 関数は、0 から +32767 の範囲内の任意の数を返します。乱数ジェネレータは、ゼロ以外の値がシード引数に渡されるたびに再初期化されます。rand 関数を使用して、クロックサイクルを任意の数だけ遅らせたり、特定のアルゴリズムまたは入力ルーチンに渡すための任意のデータを生成したりすることができます。

戻り値

rand 関数は呼び出し元に int 値を返します。

>rand (0x1234) /* Initialize random generator with 0x1234 */
0x3B98

>rand (0) /* No initialization */
0x64BD
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.