nag_rand_discrete_uniform (g05tlc) generates a vector of pseudorandom integers uniformly distributed over the interval .
nag_rand_discrete_uniform (g05tlc) generates the next
from a uniform
generator (see nag_rand_basic (g05sac)
for details) and applies the transformation
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_rand_init_repeatable (g05kfc)
(for a repeatable sequence if computed sequentially) or nag_rand_init_nonrepeatable (g05kgc)
(for a non-repeatable sequence) must be called prior to the first call to nag_rand_discrete_uniform (g05tlc).
This example prints five pseudorandom integers from a discrete uniform distribution between
, generated by a single call to nag_rand_discrete_uniform (g05tlc), after initialization by nag_rand_init_repeatable (g05kfc)