cmd_randseed Function (ROM Call 0x380)

AMS 1.01 or higher bascmd.h

void cmd_randseed (CESI seed);

Executes TI-Basic 'RandSeed' command.

cmd_randseed sets the seeds for the TI-Basic random number generator. seed should point to an integer item. If it is zero, then the seeds are set to the factory defaults for the random number generator, else the value is used to calculate two seeds, which are stored in the TI-Basic system variables "seed1" and "seed2".

Note: This function controls only the TI-Basic random number generator, so it has nothing to do with the random number generator from stdlib.h (i.e. with srand). You can use the function push_rand to call the TI-Basic random number generator, but note that it is much slower than the random number generator implemented in stdlib.h.


Uses: next_expression_index, NG_approxESI, top_estack, memcpy, fpisanint, is_transfinite, estack_to_float, _bcd_math


See also: push_rand