Generate a random number uniformly sampled on the range 0 to 1; this is the most basic of all random number functions in monty and all other algorithms are composed from this. Quite often, you will want a number on $[0, 1]$ (e.g., for a Bernoulli trial), and this function is the most efficient way of generating one.
Arguments
- state
The random number state, from monty_rng_create
- n_samples
The number of samples to take, per stream. When using the multiple-sample interface, all other parameters are held constant (per stream).
Examples
state <- monty_rng_create()
monty_random_real(state)
#> [1] 0.1939092
monty_random_n_real(5, state)
#> [1] 0.2963319 0.8661954 0.9584540 0.4874878 0.5368272