[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: random is not random [never mind]
From: |
Matt Wette |
Subject: |
Re: random is not random [never mind] |
Date: |
Sat, 13 Feb 2016 13:34:57 -0800 |
NEVER MIND
> On Feb 13, 2016, at 1:30 PM, Matt Wette <address@hidden> wrote:
>
> Every time I execute
> $ guile -c '(simple-format #t "~S\n" (random 100))’
> I get the same result.
>
> Is this a bug?
>
> It happens in guile-2.0.11 and guile-2.1.2.
>
> Matt
I found this in the manual:
Note that the initial value of *random-state* is the same every time Guile
starts up. Therefore, if you don’t pass a state parameter to the above
procedures, and you don’t set *random-state* to (seed->random-state your-seed),
where your-seed is something that isn’t the same every time, you’ll get the
same sequence of “random” numbers on every run.
(set! *random-state* (random-state-from-platform))