how to break a very long int into a list


    Feb 20 2007 | 4:58 am
    Hi list,
    Can't seem to figure out how to do this - I'm sure there's some easy way.
    I need to insert a space between each digit of a very long int.
    Sending an int into an atoi object works fine with ints
    Any help would be greatly appreciated.

    • Feb 20 2007 | 6:03 am
      I think one problem you might run into is that the largest int you can have is 2147483647 (others on this list are better versed in this that I am). Larger #'s will be "adjusted" to fall within the range of +/- 2147483647 (again...others can certainly speak with more authority on this than I can...so apologies if not 100% accurate). If somehow this list of #'s were stored as a string instead, e.g."123451234512345", you could use regexp.
      David
    • Feb 20 2007 | 7:00 am
      Zachary Seldess wrote: > I need to insert a space between each digit of a very long int. > > Sending an int into an atoi object works fine with ints > long. After that it starts doing strange things that I don't > understand. My number is much longer than 10 digits, so that doesn't > seem to be the way to go.
      You would need to make sure, that you send it always as symbol. Elsewise its interpreted as integer number which has a limit according to 32-bits. which would turn some numbers into negative numbers and such. Always surround the number with quotes and then send it to atoi...
      Stefan
      -- Stefan Tiedje------------x------- --_____-----------|-------------- --(_|_ ----|-----|-----()------- -- _|_)----|-----()-------------- ----------()--------www.ccmix.com
    • Feb 20 2007 | 10:58 am
      If we could get OpenDragon to port their V objects to UB, Vencode 10 10 10 10 ....would break the number into individual digits. Writing things to the text object causes spaces between characters - usually a nuisance.
      On 2/19/07 11:58 PM, "Zachary Seldess" wrote:
      > > Hi list, > > Can't seem to figure out how to do this - I'm sure there's some easy way. > > I need to insert a space between each digit of a very long int. > > Sending an int into an atoi object works fine with ints > After that it starts doing strange things that I don't understand. My number > is much longer than 10 digits, so that doesn't seem to be the way to go. > > Any help would be greatly appreciated. > -- > http://www.zacharyseldess.com > http://www.newmedialab.cuny.edu/projects > http://www.intermediaartsgroup.com
      Cheers Gary Lee Nelson Oberlin College www.timara.oberlin.edu/GaryLeeNelson
    • Feb 20 2007 | 7:35 pm
      Thanks everyone for the help. It seems that sending the number to atoi as a symbol DOES work, but only up to a certain size (something like 120 digits - I remember some similar limit with lists when working with coll, etc.). So it's still not my solution. I now have a javascript solution though.