chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Big Randoms


From: Kon Lovett
Subject: Re: [Chicken-users] Big Randoms
Date: Thu, 10 Mar 2011 19:44:19 -0800


On Mar 10, 2011, at 7:26 PM, David N Murray wrote:

$ csi

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
macosx-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2010-12-08 on sauron.local (Darwin)

#;1> (use srfi-27)
[snip loadings]
; loading /usr/local/lib/chicken/5/numbers.import.so ...
; loading /usr/local/lib/chicken/5/regex.import.so ...
; loading /usr/local/lib/chicken/5/srfi-27-numbers.import.so ...
; loading /usr/local/lib/chicken/5/srfi-27.so ...
[snip more loads]
; loading /usr/local/lib/chicken/5/numbers.so ...
; loading /usr/local/lib/chicken/5/srfi-27-numbers.so ...
[snip more loads]
#;2> (random-integer (expt 2 32))
Floating point exception
$

I'm working on a genetic algorithm framework and ran into this while
testing.  Is there something I'm missing, or should I be trying to
implement the dna handling in chunks of 31 bits? (random-integer (expt 2
31)) works fine.

Hi David,

I get the folllowing:

$ csi -n

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.5
macosx-unix-gnu-ppc [ manyargs dload ptables ]
compiled 2011-02-03 on Nikko.local (Darwin)

#;1> (use srfi-27)
; loading /usr/local/chicken/5/lib/chicken/6/srfi-27.import.so ...
; loading /usr/local/chicken/5/lib/chicken/6/scheme.import.so ...
<snip>
; loading /usr/local/chicken/5/lib/chicken/6/srfi-4-checks.so ...
; loading /usr/local/chicken/5/lib/chicken/6/srfi-4-errors.so ...
#;2> (expt 2 32)
4294967296.0
#;3> (random-integer (expt 2 32))
3682515858.0

but notice that this is Chicken 4.6.5 & I do not have 4.6.0 installed so I cannot try it.

In reference to your question about "... chunks of 31 bits" 'random- integer ' accepts any exact integer in the full numeric tower as a bound.

What happens w/ 4.6.0 when you import 'numbers' into the toplevel? i.e.

(use numbers srfi-27)
(expt 2 32) ;=> ???
(random-integer (expt 2 32)) ;=> ???

Best Wishes,
Kon


TIA,
Dave

_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

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