[plt-scheme] Generating Random bignums

From: Williams, M. Douglas (M.DOUGLAS.WILLIAMS at saic.com)
Date: Tue Jan 2 11:00:25 EST 2007

Either the random-integer functions in SRFI 27 or the random-uniform-int
in the science collection can generate bignums - just make n large
enough.

 

> (require (planet "random-source.ss" ("williams" "science.plt")))

> (random-integer 1000000000000000)

857437040003355

> (random-uniform-int 1000000000000000000000)

734223619338075933532

> 

 

Doug

 

________________________________

From: plt-scheme-bounces at list.cs.brown.edu
[mailto:plt-scheme-bounces at list.cs.brown.edu] On Behalf Of Marco Morazan
Sent: Tuesday, January 02, 2007 8:52 AM
To: plt-scheme at list.cs.brown.edu
Subject: [plt-scheme] Generating Random bignums

 

Dear all,

 

Is there a primitive or library function to generate random bignums? I
can't seem to find anything using PLT's help desk.

 

Many thanks in advance for your responses.

 

Cheers,

 

Marco

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070102/942636dd/attachment.html>

Posted on the users mailing list.