If the number is 0 then move one to the left until it finds a positive number.
You basically have the position of the current digit.
so
10000000000000000000000000000000000000000003 - 568
Position = 0
first[0] = 3
second[0] = 8
Basically you want to find the first number greater than 0. Then subtract 1 from that number and make all the 0's between that number and the current position a 9.
So that would mean the first number greater than 0 would be: 1 at position 43ish?
So now we must move it over to the right by adding 10 and subtracting 1 (making them 9 and adding 10 to current position) which results in:
09999999999999999999999999999999999999999993 The 3 is now a 13 really so we can do:
13 - 8 = 5
Now we have 0999999999999999999999999999999999999999999 - 56 = 005
9 - 6 = 3
now we have 099999999999999999999999999999999999999999 - 5 = 035
9 - 5 = 4
now we have 09999999999999999999999999999999999999999 - ? = 435
now we are out of bounds on second number so we must prepend everything which results in: 09999999999999999999999999999999999999999435
09999999999999999999999999999999999999999435 <--confirmed at
http://web2.0calc.com/
Funny I tried confirming with the calculator that comes with windows and was thinking wow I am really bad at math because it was saying the result was: 9999999999999999999999999999432 but I just couldn't think of a way how they ended with such little digits and a 2 as first digit. Then I jumped to conclusion it couldn't handle the large number.