[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(random) problems
- Subject: (random) problems
- From: Paul.Rosenbloom@CMU-CS-G@CMU-CS-A
- Date: Sun, 28 Nov 82 16:47:28 GMT
- Apparently-to: franz-friends-local@mit-mc
- Mail-from: CMUFTP host CMU-CS-G received by CMU-10A at 28-Nov-82 11:48:21-EST
- Original-date: 28 Nov 1982 11:47:28-EST
I am having two problems using (random) in Franz lisp. The first problem is
that I can't find any way to set the seed. Every time I enter lisp, the
generator is in the same state. I have had to resort to cfasling a c
procedure that calls srand() (as (random) seems to be defined in c by a call
on rand()). Is there a way to do this within lisp? The other problem is
more serious. The generator seems to generate tight cycles for (at least)
arguments that are small powers of 2. For example, repeatedly executing
(random 2) yields the sequence 01010101..., and (random 4) yields
01230123.... These sequences apparently occur no matter to what value I set
the seed. Does anyone one know what I could be doing wrong, or have a
working random number generator?