[Ecls-list] Re: Still seeing (random <larger integer>) ==> 0

Dave hundo at yahoo.com
Mon Feb 28 19:22:08 UTC 2005


Paul F. Dietz wrote:
> Julian Stecklina wrote:
> 
>> On Sat, 26 Feb 2005 21:15:13 -0600
>> "Paul F. Dietz" <dietz at dls.net> wrote:
>>
>>
>>> bash-2.05b$ ls -l /usr/local/bin/ecl
>>> -rwxr-xr-x    1 root     root         3700 Feb 26 21:10
>>> /usr/local/bin/ecl bash-2.05b$ /usr/local/bin/ecl
>>> ECL (Embeddable Common-Lisp) 0.9e
>>> Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
>>> Copyright (C) 1993 Giuseppe Attardi
>>> Copyright (C) 2000 Juan J. Garcia-Ripoll
>>>         ECL is free software, and you are welcome to redistribute it
>>> under certain conditions; see file 'Copyright' for details.
>>> Type :h for Help.  Top level.
>>> > (random 100000000000000)
>>> 0
>>> > (random (1+ most-positive-fixnum))
>>> 0
>>> > (random (1+ most-positive-fixnum))
>>> 0
>>> >
>>
>>
>>
>> I cannot reproduce this with a current ECL from CVS on FreeBSD 5.3.
> 
> 
> I was running this on Redhat 9 (with ecl from cvs).
> 
> Configuring with --enable-local-gmp or --disable-local-gmp makes no
> difference.
> 
> Any other suggestions on things I might try?
> 
>     Paul
>


Paul,
These work fine for me on a pentium 4, but things got wierd
on an amd64 64-bit installation where even low fixnums generated 0. The
random generator apparently expects the internal random state to be
clamped to 32 bits. I added some casts to advance_random_state() in
src/c/num_rand.d and it seems to work now.
You mentioned redhat 9, any chance you are on a 64-bit cpu?

-Dave





More information about the ecl-devel mailing list