nag_rngs_discrete_uniform (g05mac) generates a vector of pseudorandom integers uniformly distributed over the interval .
nag_rngs_discrete_uniform (g05mac) generates the next
values
from a uniform
generator (see
nag_rngs_basic (g05kac) for details) and applies the transformation
where
is the integer part of the real value
. The function ensures that the values
lie in the closed interval
.
One of the initialization functions
nag_rngs_init_repeatable (g05kbc) (for a repeatable sequence if computed sequentially) or
nag_rngs_init_nonrepeatable (g05kcc) (for a non-repeatable sequence) must be called prior to the first call to nag_rngs_discrete_uniform (g05mac).
Not applicable.
None.
This example prints five pseudorandom integers from a discrete uniform distribution between
and
, generated by a single call to nag_rngs_discrete_uniform (g05mac), after initialization by
nag_rngs_init_repeatable (g05kbc).
None.