Sorry, it just occurred to me after I hit send:

(defn huge-random-number [digits]
  (BigDecimal. (apply str (take digits (repeatedly #(rand-int 10))))))

user=> (defn huge-random-number [digits]
  (BigDecimal. (apply str (take digits (repeatedly #(rand-int 10))))))
#'user/huge-random-number
user=> (huge-random-number 100)
351059648993661898964886582130900598618473253482673982382601191417855025954979909541215244440505729M

There's no guarantee that it *will* be that many digits, because if
the first digit
happens to be zero, it'll be less.  Details...

-- 
Chris Riddoch

-- 
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