Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Sets the current pseudo-random number sequence.

Files

lib_math.h/lib_math.c

Prototype

          void  Math_RandSetSeed (RAND_NBR  seed);

Arguments

seed

Initial (or current) value to set for the pseudo-random number sequence.

Returned Value

None.

Required Configuration

None.

Notes / Warnings

IEEE Std 1003.1, 2004 Edition, Section ‘rand() : DESCRIPTION’ states that “srand() ... uses the argument as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to rand()”.

Example Usage

          RAND_NBR  seed;
           
          seed = 9876;
          Math_RandSetSeed(seed);
  • No labels