[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change of random seed

From: Tim Rice
Subject: Change of random seed
Date: Sat, 6 Aug 2022 06:22:14 +0000

Hey all,

Just a heads up that I've slightly refactored the init_random function into a 
separate source file and changed the seed to use getrandom(2).

Looking over the getrandom source in gnulib, I believe this should be 
compatible with platforms other than GNU/Linux. However, if it gives you a 
problem, please let me know.

Although a small change, this foreshadows a larger body of work which people 
may find interesting. I intend to implement a `rand` program capable of 
simulating random numbers drawn from popular probability distributions.

This is intended to be analagous to functions like runif, rnorm and rexp in the 
R programming language. In future, you will be able to do things like `rand 
norm --mean=3 --stdev=1.2 10` or `rand exp --rate=5 1` from your shell, where 
the R equivalents would be `rnorm(10, 3, 1.2)` and `rexp(1,5)`.

So, the first step is to set up the skeleton with a couple of extra source 
files, and switch to a more standard way of seeding random numbers :)

~ Tim

reply via email to

[Prev in Thread] Current Thread [Next in Thread]