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

(random) problems

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?