/
Math_RandSeed()
Math_RandSeed()
Gets the next pseudo-random number following seed
.
Files
lib_math.h/lib_math.c
Prototype
RAND_NBR Math_RandSeed (RAND_NBR seed);
Arguments
seed
Initial (or current) value to set for the pseudo-random number sequence.
Returned Value
Next pseudo-random number in the sequence following seed
.
Required Configuration
None.
Notes / Warnings
Pseudo-random number generated implemented as a Linear Congruential Generator (LCG). The pseudo-random number generated is in the range [0, 231).
Math_RandSeed()
is re-entrant since it calculates the next random number using only local variables.
Example Usage
RAND_NBR seed; RAND_NBR rand_nbr; seed = 9876; rand_nbr = Math_RandSeed(seed);
Related content
Math_Rand()
Math_Rand()
More like this
Math_RandSetSeed()
Math_RandSetSeed()
More like this
MATH_ROUND_INC_UP_PWR2()
MATH_ROUND_INC_UP_PWR2()
More like this
MATH_ROUND_INC_UP()
MATH_ROUND_INC_UP()
More like this
Str_FmtNbr_Int32U()
Str_FmtNbr_Int32U()
More like this
DEF_BIT_FIELD_xx()
DEF_BIT_FIELD_xx()
More like this