Another unadvertised function that is useful to be aware of is
clojure.lang.Numbers/reduce which will simplify a number to its most simple
type.  I often find that I want to use some BigInteger function, but then it
is important to turn it back into a "typical Clojure number" at the end.

For example,

(defn next-prime [n] (clojure.lang.Numbers/reduce (.nextProbablePrime
(BigInteger. (str n)))))

--Mark

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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to