Lee Spector <lspec...@hampshire.edu> writes:

> Sorry, the expression in my first sentence should have been "(. (new
> java.util.Random) (nextInt X))", not "(. (new java.util.Random)
> X)". In any event the real question isn't about this call but about
> how Clojure's rand-int should handle bignum arguments and about how to
> write a real random bignum generator. 

Also take a look a the BigInteger class' constructors.  Some of them
take a Random object and generate a number in a range up to given power
of two.  Presumably you can use this as a starting point. If you need
high quality numbers it's probably also worth looking into a
cryptographic random number generator library, rather than using
java.util.Random.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to