/
Math_Rand()

Math_Rand()

Gets the next pseudo-random number.

Files

lib_math.h/lib_math.c

Prototype

          RAND_NBR  Math_Rand (void);

Arguments

None.

Returned Value

Next pseudo-random number in the sequence.

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_Rand() is re-entrant since it calculates the next random number in critical sections.

Example Usage

          RAND_NBR  rand_nbr;


          rand_nbr = Math_Rand();

Related content

Math_RandSeed()
Math_RandSeed()
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
Str_FmtNbr_Int32S()
Str_FmtNbr_Int32S()
More like this