Given a very long (e.g. len()=10^12) string of digits:
e.g., s='23426994030208483858........38838299459942'
What I need is just to increase by 1 this string-number: '12347'+'1'='12348'.
(Note the "terrible" case: '9999'+'1'='10000')
But seems that s=str(long(s)+1) is quite expensive way to use.
Any idea or hint? PS Python 2.3.4.
e.g., s='23426994030208483858........38838299459942'
What I need is just to increase by 1 this string-number: '12347'+'1'='12348'.
(Note the "terrible" case: '9999'+'1'='10000')
But seems that s=str(long(s)+1) is quite expensive way to use.
Any idea or hint? PS Python 2.3.4.