Really embarrassing in two ways: - Could not remove my previous post. :-) - I should have tried to create such a big number (at least after reading all the answers here) before posting... It is possible to crate a 50000 digit big integer.
PS: Watch out though. The aim of the problem is to add up those 50- digit numbers and not to create one 50000-digit number. --feka On Mar 26, 12:40 am, Glen Rubin <rubing...@gmail.com> wrote: > I am trying to convert a long string of numbers to a number, but get a > java.lang.numberformatexception > > My long string of numbers has new line characters in it, so I am > filtering out the newline characters before converting it back to a > string. Then I try to use Integer. on it but get the above exception. > > Code is as follows: > big-num-str is truncated for space's sake, is actually much much > longer!! > > (def big-num-str "37107287533902102798797998220837590246510135740250 > 46376937677490009712648124896970078050417018260538 > 74324986199524741059474233309513058123726617309629 > 91942213363574161572522430563301811072406154908250 > 23067588207539346171171980310421047513778063246676 > 89261670696623633820136378418383684178734361726757 > 28112879812849979408065481931592621691275889832738 > 44274228917432520321923589422876796487670272189318 > 47451445736001306439091167216856844588711603153276 > 70386486105843025439939619828917593665686757934951....") > > (Integer. (apply str (filter #(Character/isDigit %) big-num-str))) -- 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.