rand
A command of the separate bcma command line; see Commands for other chip families.
Pseudo-random number generator.
rand GET [MAX=<value>] [MIN=<value>] [Verbose=0|1]
SEED [<value>]
Built-in help
The 'rand get' command generates a pseudo-random number and saves
the result to local variable $0.
The MAX and MIN options can be used to set the range of the generated
pseudo-random number. The default value is 0 for the MIN option and
RAND_MAX for the MAX option. The RAND_MAX value is system-dependent
and can be checked from the 'rand get =' command.
The generated pseudo-random number can be displayed on the CLI console
as well by setting the Verbose option to 1.
The 'rand seed' command sets the following argument <value> as
the seed for a new sequence of pseudo-random numbers returned from
the 'rand get' command. If no argument is specified, the current time
will be used as the seed by default.
Built-in examples
get
get max=100 min=-100
get max=0xfff v=1
seed
seed 11