Generates `n` pseudo-random values using the TempleOS constants, with an initial seed taken from the CPU timestamp counter. This code is inspired from the Linear Congruential Generator Specified in the TempleOS source code. To see the source code in TempleOS, see here.

lcg_tos(n = 1L)

Arguments

n

Number of random numbers to generate (default 1).

Value

A NumericVector of length `n`. Each value is the 64-bit state coerced to double.

Details

lcg_tos differs from lcg as the parameters are preconfigured and the random seed comes from the CPU timestamp. It is possible to configure lcg_tos with lcg, however this is ready to use preconfigured function that only requires the user to specify the number of random numbers they wish to generate.

See also

Examples

random_numbers <- lcg_tos(10000)
# Plot numbers to see that they are random
plot(random_numbers)